Set variables without PreExecute?

122 views
Skip to first unread message

Walter

unread,
Jun 23, 2011, 3:29:52 PM6/23/11
to reddot-c...@googlegroups.com
Hello,

Is it possible to set variables using Render Tags - without PreExecute?  I have the following template code that I'd like to remove PreExecute script from.  The purpose of the code is to allow editors to quickly show/hide certain page fragements on the language variants, yet still control it all from the main language variant.  I'd like to do the same thing with Render Tags - (obviously without having duplicate the HTML content 11 times within the template).

Thanks.  This is my first post, but I've stalked this group for a year now.  :)
Walter

-------------------------------

<!IoRangePreExecute>
<%
strShowLang = "<%opt_show_variant_enu%>"
IF "<%info_language%>" = "DEU" THEN
    strShowLang = "<%opt_show_variant_deu%>"
ELSEIF "<%info_language%>" = "CHS" THEN
    strShowLang = "<%opt_show_variant_chs%>"
ELSEIF "<%info_language%>" = "ESM" THEN
    strShowLang = "<%opt_show_variant_esm%>"
ELSEIF "<%info_language%>" = "ITA" THEN
    strShowLang = "<%opt_show_variant_ita%>"
ELSEIF "<%info_language%>" = "KOR" THEN
    strShowLang = "<%opt_show_variant_kor%>"
ELSEIF "<%info_language%>" = "PLK" THEN
    strShowLang = "<%opt_show_variant_plk%>"
ELSEIF "<%info_language%>" = "PTG" THEN
    strShowLang = "<%opt_show_variant_ptg%>"
ELSEIF "<%info_language%>" = "SVE" THEN
    strShowLang = "<%opt_show_variant_sve%>"
ELSEIF "<%info_language%>" = "TRK" THEN
    strShowLang = "<%opt_show_variant_trk%>"
ELSEIF "<%info_language%>" = "FRA" THEN
    strShowLang = "<%opt_show_variant_fra%>"
END IF
%>

<% IF strShowLang = "show" THEN %>

     <!--  Good chunk of HTML code goes here.... -->

<% END IF %>
 <!/IoRangePreExecute>

-------------------------------



Jeff Stine

unread,
Jun 27, 2011, 1:46:26 PM6/27/11
to RedDot CMS Users
Well, there is an undocumented function in render tags where you can
set the value of a Store item using an output tag. It is rather messy,
but your code would be something like:

<reddot:cms>
<output type="object" object="Store:Set(strShowLang,<
%opt_show_variant_enu%>)" />
<if>
<query valuea="<%info_language%>" operator="==" valueb="DEU">
<output type="object" object="Store:Set(strShowLang,<
%opt_show_variant_deu%>)" />
</query>
<query type="else">
<if>
<query valuea="<%info_language%>" operator="=="
valueb="CHS">
<output type="object" object="Store:Set(strShowLang,<
%opt_show_variant_chs%>)" />
</query>
<query type="else">
<if>
<!-- ...repeat for each language -->
</if>
</query>
</if>
</query>
</if>
<if>
<query valuea="Store:strShowLang" operator="==" valueb="show">
<htmltext>
<!-- Good chunk of HTML goes here ... -->
</htmltext>
</query>
</if>
</reddot:cms>

Jian Huang

unread,
Jun 27, 2011, 6:07:35 PM6/27/11
to RedDot CMS Users
Hi Jeff,

I have had some experience with store rendertag and would like to
share it here.

The store rendertag appears to be a variable internally.

Since rendertag is somewhat multi-threaded internally, when using
store rendertag, you can't really ensure what you stored will be what
you will be getting back.

-Jian

Walter Willis

unread,
Jun 27, 2011, 6:04:14 PM6/27/11
to reddot-c...@googlegroups.com
Thanks so much Jeff.  That's exactly what I was looking for!  I'll test it to see how it works.  How does one find these "undocumented" render tags?  Are they just tricks of the trade, discovered by trial and error?

Walter

--
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.




--
Walter  8-)
I will boast in the Lord my God!

Jeff Stine

unread,
Jun 28, 2011, 8:21:37 AM6/28/11
to RedDot CMS Users
Check out http://www.reddotcmsblog.com for more info.

theHam

unread,
Jun 29, 2011, 5:10:55 AM6/29/11
to RedDot CMS Users
You'll want to check out Dennis Reil's blog article this seems like
it's going to get a whole lot easier to do soon. Custom render tags
here we come!

http://websitemanagement.reil-online.de/2011/06/developing-custom-rendertags.html

On Jun 28, 10:21 pm, Jeff Stine <jls1...@gmail.com> wrote:
> Check outhttp://www.reddotcmsblog.comfor more info.

Walter Willis

unread,
Jun 29, 2011, 12:09:56 PM6/29/11
to reddot-c...@googlegroups.com
This is working great so far.  Thanks!

Walter

--
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.

Jian Huang

unread,
Jun 29, 2011, 1:21:10 PM6/29/11
to RedDot CMS Users
Hi Walter,

Glad it is working. Please note that this is unsupported undocumented
rendertag.

From experience, the store rendertag output unreliable information
upon full site or section publishes.

Best regards,

-Jian
Reply all
Reply to author
Forward
0 new messages