Hi Everyone,

SUMMARY
To make a long story short, I am attempting to output the values of an
info placeholder of a particular set of (master) pages from within a
render spot in a separate content class.

If this is enough information for you, then you can skip all the gory
details. If you need more info, here it is:

DETAILED DESCRIPTION OF PROBLEM
1. Every night, we run an automatic publishing job which uses the
Navigation Manager to traverse the entire navigation structure of our
site and build (and then publish) a single XML file based on the
Google Sitemaps protocol (http://en.wikipedia.org/wiki/
Google_Sitemaps).
2. Everything functions fine except for the <lastmod> elements of the
Google Sitemaps protocol, which is supposed to contain the date on
which each page in the site was last modified.
3. The obvious way to do this would be to add a line within the render
spot such as:

<lastmod><%!!
Context:CurrentIndex.Page.Elements.GetElement(inf_modification_date).GetHtml() 
!!
%></lastmod>

where inf_modification_date represents an Info placeholder of type
“Page: Modification Date”.
4. The problem is, as I’m sure many of you already know, the above
line of code will not work because GetElement().GetHtml() does not
work with Info placeholders, it only works with Standard Field and a
limited range of other types of placeholders. (When called on an Info
tag, it renders the empty string.)

ATTEMPTED SOLUTION
1. I though I would outsmart the CMS by adding to the master page, RQL
which dumps the contents of inf_modification_date into a Standard
Field placeholder named “stf_modification_date”, which could then be
accessed from the render spot. I added the following piece of code to
the master page’s template:

<reddot:cms>
   <if>
       <query valuea="Context:CurrentRenderMode" operator="=="
valueb="Int:1">
           <htmltext>

<%
‘ only function SetElementValue is shown here; functions that it calls
are omitted here for the sake of brevity

function SetElementValue( pageguid, elementname, value )
  XMLData = "<IODATA loginguid='<%inf_loginguid%>' sessionkey='<
%inf_sessionkey%>'>" &_
     "<PAGE guid='" & pageguid & "'>" &_
        "<ELEMENTS action='load'/>" &_
     "</PAGE>" &_
     "</IODATA>"
resultXML = sendXML(XMLData)
resElementGUID = getElementGUID( resultXML, "ELEMENT", "eltname",
elementname )
  XMLData = "<IODATA loginguid='<%inf_loginguid%>' sessionkey='<
%inf_sessionkey%>'>" &_
     "<ELEMENTS action='save'>" &_
        "<ELT guid='" & resElementGUID & "' value='" & value & "'>" &_
        "</ELT>" &_
     "</ELEMENTS>" &_
     "</IODATA>"
  resultXML = sendXML(XMLData)
end function

setpublished = SetElementValue( ”<%inf_page_guid%>”,
”stf_modification_date”, ”<%inf_modification_date%>”)
%>

           </htmltext>
       </query>
   </if>
</reddot:cms>

2. The problem here is that, while this does indeed dump the contents
of inf_modification_date into stf_modification_date, it only does so
when the page is accessed in SmartEdit, due to the render spot
(separate from the above-mentioned render spot) that the code is
wrapped in. Therefore, it will not dump the contents if, for instance,
the page is modified from within SmartTree, though admins may need to
do this. (Without this render spot, the ASP code will be passed on to
the published page, which is unacceptable. I also tried to wrap the
code in pre-execute blocks instead of the render spot, but then the
code seemed not to be executed at all.)

3. There is another problem as well: Even when the code does execute
(at the time the page is accessed in SmartEdit), stf_modification_date
receives the value of inf_modification_date *before*
inf_modification_date receives its new value. Thus, the value of
stf_modification_date will always lag behind by one iteration. For
example, if I modify a given page 2 times, once at 4:12 PM and at
again at 4:22 PM, then, when I am done with these two modifications,
stf_modification_date will hold the value “4:12 PM”, and not the value
“4:22 PM”, as would be expected (or at least hoped for). If I then
access the page a third time in SmartEdit (say, at 4:35PM), as soon as
I navigate to the page in SmartEdit to edit it, stf_modification_date
will receive the old value of inf_modification_date (“4:22 PM”), and
then, only afterwards, will inf_modification_date will receive its new
value (“4:35 PM”).

Therefore, this does not seem like a viable option.

CONCLUSION
It seems that, somehow, I must get the value of inf_modification_date
directly from within the (first) render spot. Any ideas? Can I embed
RQL calls into the render spot? Is there only a LiveServer solution to
this problem (perhaps importing inf_modification_date and then using a
query or a target dynament to build the Google Sitemmaps XML)? Are
there other solutions that you can think of?

Any insights and suggestions are much appreciated.

Thanks in advance,
Michael Klosner

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

Reply via email to