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

    The following is my ditto call

    [[Ditto? &parents=`19` &display=`5` &total=`5` &tpl=`bloghome_tpl` &dateSource=`pub_date` &dateFormat=`%m/%d/%y` &sortBy=`pub_date` &filter=`id,22,2` ]]
    


    and the bloghome_tpl chunk:

    <div class="blog_teaser">
    <h2>[+title+]</h2>
    <p>
    [+blog_teaser+]
    </p>
    <a href="[~[+id+]~]">continue ></a>
    posted by [+author+] on [+date+] 
    
    [!printComments? &numComments=`[[Jot? &docid=`[+id+]` &action=`count-comments`]]` &docID=`[+id+]` !]
    </div>
    


    The printComments snippet simply prints the number of comments for a particular blog post along with some html for styling. And if there is no comments then nothing is returned.

    This all works fine. The problem comes when I’m using Reflect.

    Reflect call

    [!Reflect?config=`wordpress` &targetID=`22` &getDocuments=`1` &dittoSnippetParameters=`parents:19|filter:id,22,2` &id=`wp` &dateSource=`pub_date` &tplContainer=`archive_tplContainer` !]
    


    and here’s the ditto call for the landing page (22)

    <h2>[+wp_month+] [+wp_day+] [+wp_year+]</h2>
    
    [!Ditto? &id=`wp` &extenders=`dateFilter` &parents=`19` &display=`10` &total=`all` &tpl=`bloghome_tpl` &dateSource=`pub_date` &dateFormat=`%m/%d/%y` &sortBy=`pub_date` &filter=`id,22,2` !]
    


    On this page the ditto tpl does not parse the printComments snippet but actually prints out the text of the snippet call (with the Jot snippet successfully parsed leaving a number in that parameter.

    Is there a way that I can fix this?

    Thanks
      • 18397
      • 3,250 Posts
      You need to alternate between [! and [[ calls for any snippet which calls another snippet. Thus, if Ditto is cached, any snippet contained in a chunkmust be uncached, and any snippet those reference must be cached.