We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 630
    • 39 Posts
    Hello,

    Given that call:

    [+phx:if=`[+domain+]`:is=``:then=`[[Ditto? &tpl=`rss_fulltext_item` &parents=`103`]]`+]


    Definition of chunk ’rss_fulltext_item’:

    <item>
    <title><![CDATA[ [+title+] ]]></title>
    <link>[(site_url)][~[+id+]~]</link>
    <description><![CDATA[ [+content+] ]]></description>
    <pubDate>[+createdon:date=`%a, %d %b %Y %H:%M:%S +0100`+]</pubDate>
    </item>


    This results in a final output containing plain [tt][+phx:if ... +][/tt] clutter. If I take an html chunk or something instead, PHx resolves it all fine.

    The call [tt][+phx:if=`1`:is=`1`:then=`<![CDATA[ [+title+] ]]>`+][/tt] does not output anything.

    Do I fail to see some mistake on my side? Otherwise, isn’t that a bug?


    -- agilero.

    p.s. Could you moderator please move my thread to the PHx forum? Just realized that it fits better there (evolved from my original assumption that the phenomenon had something to do with ditto). Thank you very much
      • 4310
      • 2,310 Posts
      One idea is to put the Ditto snippet call in a chunk, then using the chunk name in the Phx ?
        • 630
        • 39 Posts
        Thanks, it didn’t work though. So I dropped the PHx method and made a snippet:

        <?php
        global $modx;
        
        $dittoParams = array( 'tpl' => $tpl );
        
        if ( $domain ) {
            $dittoParams['documents'] = $modx->runSnippet( 'TaggoNG', array( 'do' => 'getIDlist', of => $domain ));
        }
        else { $dittoParams['parents'] = 103; }
        
        return $modx->runSnippet( 'Ditto', $dittoParams );
        ?>


        The call is [tt][[blogFeed? &tpl=`rss_fulltext_item` &domain=`[+domain+]` ]], works fine now, had to make page uncached though. Btw: TaggoNG is an own creation of a tagging system which is easy to use but not to install, yet. $domain is both at the same time: the tag and the ID of the landing page. The over-all snippet is hence a switch between "recent blog-posts" and "recent blog-post in category xyz"


        -- agilero.