Regex, verbatim string literals, list

57 views
Skip to first unread message

Kristaps Karlsons

unread,
Nov 4, 2010, 7:58:18 AM11/4/10
to reddot-c...@googlegroups.com
Hi, list.

I'm currently developing rss feed for our homepage. The problem we're having is - we need to replace description to show images properly in rss.

Currently I'm stuck here:
<%
string descr; // define string descr outside of loop
%>

<!IoRangeList><!IoRangeNoRedDotMode><!IoRangeRedDotMode><%list_nextLevel%><!/IoRangeRedDotMode><!/IoRangeNoRedDotMode>
<item>
    <title><![CDATA[<%headline%>]]></title>
    <link>http://www.example.com<%list_nextLevel%></link>
    <pubDate><%info_timedate_created%> <%= timeZone %></pubDate>
    <description><![CDATA[<%
        descr = @"<%text%>"; // exception
    %>]]></description>
</item>
<!/IoRangeList>

The problem is - <%text%> is multiline text with unescaped single quotes (e.g. <a href="url">text</a>).

Best regards,
Kristaps

reddotrich

unread,
Nov 4, 2010, 8:41:47 AM11/4/10
to RedDot CMS Users
Hi Kristaps,

We had the same issue getting them into c# strings, in the end we went
for:

string descr = @"<%!!
Escape:HtmlEncode(Context:CurrentPage.Elements.GetElement(String:text).Value) !!
%>";

which seems to work well for us, we do of course have to unencode it
later.

Rich

Kristaps Karlsons

unread,
Nov 4, 2010, 8:59:25 AM11/4/10
to reddot-c...@googlegroups.com
Hi, Rich.

Unfortunately it returns nothing. Do I have to wrap it with <reddot:cms></reddot:cms> or change Context (as you see, I'm in a list_nextLevel loop)? I haven't used render tags previously.

Thank you.

--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
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.


reddotrich

unread,
Nov 4, 2010, 9:35:25 AM11/4/10
to RedDot CMS Users
Hi,

Not used it in a loop like that, but you won't need the <reddot:cms>
tags as it has the <%!! instead. You can look it up in the Navagion
Manager PDF for clarification. Which reminds me, for this to work you
will need Nav Man turned on.

Rich

On Nov 4, 12:59 pm, Kristaps Karlsons <ska...@skakri.net> wrote:
> Hi, Rich.
>
> Unfortunately it returns nothing. Do I have to wrap it with
> <reddot:cms></reddot:cms> or change Context (as you see, I'm in a
> list_nextLevel loop)? I haven't used render tags previously.
>
> Thank you.
>
> On Thu, Nov 4, 2010 at 2:41 PM, reddotrich <reddotr...@googlemail.com>wrote:
>
>
>
> > Hi Kristaps,
>
> > We had the same issue getting them into c# strings, in the end we went
> > for:
>
> > string descr = @"<%!!
> > Escape:HtmlEncode(Context:CurrentPage.Elements.GetElement(String:text).Valu­e)
> > reddot-cms-use...@googlegroups.com<reddot-cms-users%2Bunsubscrib­e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/reddot-cms-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

kimdezen

unread,
Nov 7, 2010, 7:22:49 PM11/7/10
to RedDot CMS Users
To use it inside a list loop, you will need to use something like
this:
Context:Pages.GetPage(Guid:<%inf_pageguid%>)
** the pageguid info element of the page will need to passed through
to the loop for it to work ***

There is a performance hit using this method, so i would only suggest
using it if you are only returning a moderate amount of pages in the
list.

Kim


On Nov 4, 11:59 pm, Kristaps Karlsons <ska...@skakri.net> wrote:
> Hi, Rich.
>
> Unfortunately it returns nothing. Do I have to wrap it with
> <reddot:cms></reddot:cms> or change Context (as you see, I'm in a
> list_nextLevel loop)? I haven't used render tags previously.
>
> Thank you.
>
> > reddot-cms-use...@googlegroups.com<reddot-cms-users%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages