Render Tags in OpenText 11 - Replacing RQL for Inheriting Placeholder Values

910 views
Skip to first unread message

Rob

unread,
Dec 5, 2012, 3:38:17 PM12/5/12
to reddot-c...@googlegroups.com
I have migrated a project from OpenText 9 to 10.1 to 11 and found the RQL for getting the image of the parent page no longer works.  We have replacement code for this written in Render Tags that works on another project in OpenText 10.1 but this code is not working on this project in OpenText 11.  I suspect the problem is OpenText 11.  Can someone look at the code to spot a problem with syntax or concept?

In testing, it seems the line with GetElement is the one causing an error, and only if the code finds the placeholder on a parent page.

Rob



Here's the code:

<!IoRangePreExecute>
<%
   ' This code is to inherit the banner image and section ID from parent/grandparent/etc pages. This replaces a deprecated solution that relied on RQL in template code.
   Dim inherited_image, current_image
   <reddot:cms>
       <!-- Loop over this page each ancestor page, working down the tree -->
       <foreach itemname="Index" object="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage).GetPathArray()">
           <htmltext>
               ' Retrieve the url of the image set on that page
               current_image = "<%!! Store:Index.Page.Elements.GetElement(img_InlineImage).GetHtml() !!%>"
               ' If an image was set
               If current_image <> "" Then
                   ' Set the inherited image to the current image
                   inherited_image = current_image
               End If
           </htmltext>
       </foreach>
   </reddot:cms>
%>
<% If Not IsNull(inherited_image) Then %>
   <img src="<%= inherited_image %>" alt="" />
<% End If %>
<!/IoRangePreExecute>


Here's the error:

An error occured:

Error in BuildPage_PreExecute: System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at OpenText.WS.MS.Core.Http.UrlHelper.Request(String url, String proxyHost, Int32 proxyPort, String postData)

The page cannot be displayed.
Check the RDExecute and PreExecute settings.


Jian Huang

unread,
Dec 5, 2012, 4:54:16 PM12/5/12
to reddot-c...@googlegroups.com
Rob,

Ah, the good old image inheritance script that uses rendertag to list all ancestral images and then preexecute to use the nearest one.

Easiest way to troubleshoot this is to remove the surrounding preexecution blockmark and see what code is generated.

I suspect that it generated:

current_image = "<img src="xxx.jpg">"

instead of the desired

current_image = "xxx.jpg"

Why is it breaking?  Quotes inside quotes.  VBScript don't like it.

-Jian

Rob

unread,
Dec 6, 2012, 2:09:52 PM12/6/12
to reddot-c...@googlegroups.com
Jian,
 
Great.  That was the issue.
 
Hey, when might you have that RQL code that allows us to use old RQL code in version 11?
 
I have another layer of issue.  I found I am not getting the attributes of the element, attributes that I have either requested to be published for the placeholder or added as a suplement. 
 
Here is what I want:
 
<img src="/images/about-lim/FAshionOpolis.jpg" width="321" height="358" border="0" id="bigImg" alt="Fashionopolis">
 
Here is what I get:
 
<img src="/images/about-lim/FAshionOpolis.jpg">
 
I'd like to get it thru render tags.  Any ideas?  For now, I will hard code these since we need to go live with this version 11 install but I want a content editor to be able to change any of them on a ancester page and it propogate to this page.
 
Another issue I think I will have.  I recall the element values render tags provides isn't necessarily the most current.  If a content editor changes the element value on an ancester, I won't be gauranteed to get it with this code.  Right?
 
Rob

Jian Huang

unread,
Dec 6, 2012, 3:57:23 PM12/6/12
to reddot-c...@googlegroups.com
Yeah, you can't get them via rendertag, and yes, that is the rendertag cache issue I was talking about.

I would change the code to use AJAX to inherit.

-Jian

Rob

unread,
Dec 6, 2012, 6:36:13 PM12/6/12
to reddot-c...@googlegroups.com
Jian,
 
Since they rarely change the image (it's the banner we are inheriting), we will go with the Render Tags solution for now.  It leaves us open for some risk but it doesn't limit our options for later and it gets us out of old RQL on our WSM 11 install. 
 
Once you have that RQL fix available and old RQL code will work in WSM 11, do you feel the AJAX approach is best or an RQL approach is best.
 
Rob

Jian Huang

unread,
Dec 10, 2012, 9:59:06 AM12/10/12
to reddot-c...@googlegroups.com
Hi Rob,

The RQL fix is available, already being used in some of my version 11 compatible plugins at http://simplyreddot.blogspot.com/p/plugins.html

In this case, I would recommend skipping RQL and go with the AJAX approach because is it easier to get more help and learn AJAX than RQL.

The AJAX method is relatively simple actually:
1.  Use the breadcrumb block mark to create a crumb trail from home page to current page.  If you don't want the breadcumb to be visible, hide it with css, but make sure it is available in the HTML DOM.

2. Inheritance, this is where the magic happens.  Using JavaScript/Jquery, start from the last breadcrumb, AJAX the link and get banner.  No banner?  Next breadcrumb up.  Still no?  Keep going until last breadcrumb, Home?

Performance: terrible approach on mobile phones or slow network because the number of AJAX/HTTP calls per page.  The secret sauce is in how to do this efficiently.

Best regards,

-Jian

Bob Foster

unread,
Dec 10, 2012, 10:58:04 AM12/10/12
to reddot-c...@googlegroups.com, reddot-c...@googlegroups.com
Jian,

Won't the AJAX solution have the weakness of no response if the client browser has JavaScript turned off?  I suspect this is unlikely enough of a weakness these days we will go this route, but a little later when we have more dev time.

You have a good example to point me to?

Is it possible to get just the new RQL fix by itself, just for future referral?

Rob

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/reddot-cms-users/-/QtQVvQptFVcJ.
To post to this group, send email to reddot-c...@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.

Jian Huang

unread,
Dec 10, 2012, 11:04:43 AM12/10/12
to reddot-c...@googlegroups.com
Hi Rob,

<noscript>fall back image here</noscript>

The all version compatible RQL connector is available in some of my plugins.  Unfortunately, my time is being prioritized by other tasks, so I am not sure when I can isolate it out to a separate deliverable.  Alternatively, you can reach out to OpenText US Consulting Services.

Best,

-Jian
Reply all
Reply to author
Forward
0 new messages