We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8749
    • 7 Posts
    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.
      • 36592
      • 970 Posts
      How about using cached form [[Now_Date_Time]] in the chunk ?
        • 8749
        • 7 Posts
        Thank you, it works.

        Can you explain why the cached version works?

        E.
          • 36592
          • 970 Posts
          Quote from: ELMIT at Feb 21, 2008, 05:27 PM

          Can you explain why the cached version works?
          I do not know much about the core of MODx, but it has something to do with the parsing system in MODx core. Maybe the core team can explain why it shold be...
            • 22303 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.