I am sure I just need a slight push! It is my first day with MODx!!!
I want to use on a page my own headline and the current date.
I have setup a page with a chunk {{QOT}}
which includes:
...
[!Headline? &Headline=`My new page` !]
...
The Snippet Headline looks like:
<?php
echo "<thead>
<tr>
<th colspan=\"6\">
<h2>$Headline</h2>
</th>
</tr>
<tr>
<th colspan=\"6\" class=\"right\">
{{HeadlineDate}}
</tr>
</thead>";
?>
I had first the code directly for the chunk {{HeadlineDate inside}}
<span style="margin-left: 2em">Date:</span>
<input type="text" id="WWMQuoDate" class="YMDHIS" readonly="true" value=[!Now_Date_Time!] />
I get the page with the correct varialbe "My new page", but the Date is shown as [!Now_Date_Time!]
What am I missing?
bye
E.
How about using cached form [[Now_Date_Time]] in the chunk ?
Thank you, it works.
Can you explain why the cached version works?
E.
-
MODX Staff
- 10,725 Posts
This seems to be common problem when using cached pages and embedding non-cacheable snippet calls within other non-cacheable snippet calls (I think it’s either running out of iterations or is not dealing properly with parsing multiple levels of non-cacheable tags). The solution is to make sure not to nest non-cacheable calls within the content returned by other non-cacheable calls. This will not be a limitation in upcoming releases featuring a new core and parser.