There is a solution (described at:
http://webdjinn.com/blog/2008/12/09/escaping-reddot)
which utilises Jscript to do the job. I've included the applicable
portions from my working template.
My thanks to Adrian Mateljan and Tom Halett for their invaluable
assistance.
1. Add the following routine to the top of your template
<!IoRangePreExecute>
<script language="jscript" runat="server">
function getVar(id) {
var ver = Number(ScriptEngineMajorVersion() + "." +
ScriptEngineMinorVersion())
var err = "";
// Test JScript version.
if (ver >= 5.5) {
var strsrc = eval(id + ".toString()");
var pattrn = /\/\*([\s\S]*)\*\//;
return pattrn.exec(strsrc)[1];
} else {
err = "<error>You need a newer version of JScript for this to
work</error>";
return err;
}
}
</script>
<!/IoRangePreExecute>
2. Use render tags to create unique jscript functions for each text
item
The render tag example below creates a uniquely names function for
each instance of a particular text element, using a render tag counter
called: newsCounter to apply a unique identifier to each function
instance.
<reddot:cms>
<foreach itemname="newsPage" object="Context:Pages.GetPage(Guid:<
%stf_AnotherPageGUID%>).Elements.GetElement(lst_pageNavigation).Value"
countername="newsCounter">
<htmltext>
<script language="jscript" runat="server">
function newsTeaserHolder_<%!! Store:newsCounter !!%>() {
/*<%!! Escape:HtmlDecode(Store:newsPage
[Int32:newsCounter].Elements.GetElement(con_Body).Value
[Int32:0].Elements.GetElement(txt_ArticleTeaser).Value) !!%>*/
}
</script>
</htmltext>
</foreach>
</reddot:cms>
3. Call the Jscript function, to return the text element value with
carriage returns stripped out
<reddot:cms>
<foreach itemname="newsPage" object="Context:Pages.GetPage(Guid:<
%stf_AnotherPageGUID%>).Elements.GetElement(lst_pageNavigation).Value"
countername="newsCounter">
<htmltext>
<%
newsTeaser = getVar("newsTeaserHolder_<%!! Store:newsCounter !!
%>")
%>
</htmltext>
</foreach>
</reddot:cms>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/RedDot-CMS-Users?hl=en
-~----------~----~----~----~------~----~------~--~---