• snippet in the ditto called chunk#

  • virtualbear Reply #1, 1 year, 9 months ago

    Reply
    Hi,

    i've juste ran into a slight issue i can't find the reason

    i've a ditto call ending with the usual &tpl=`toto`, in that "toto" chunk i call a snippet [!anotherToto!]
    this snippet is used to add another chunk inside the first one depending on the content var being empty or not

    everything works fine calling {{toto}} in a page (with TV vars instead of ditto placeholders in toto of course)

    the ditto call displays the first chunk fine but displays the snippet call [!anotherToto!] instead of getting the snippet output

    then i'm wondering if there is a peculiar way to achieve this within a ditto call or would writing a snippet that ouputs two different ditto call depending on that content value the only way to get it work ?

    thanks for any advice
    have swing

    PS of course, is it necessary to say that all this in written without richtext in the template and outputs [! !] correctly in the source code ?


  • bunk58 Reply #2, 1 year, 9 months ago

    Reply
    Have you tried uncached [!Ditto!] and cached


  • sottwell Reply #3, 1 year, 9 months ago

    Reply
    The way uncached snippets work, they are not processed at all until all the rest of the document is finished. So your poor Ditto call is never getting anything to work with; all it ever sees is the snippet tags instead of your snippet' output. By calling Ditto uncached and your snippet cached, your snippet gets processed and its output is now available for when the Ditto snippet is finally processed.


  • virtualbear Reply #4, 1 year, 9 months ago

    Reply
    hi David and Susan,

    well, my Ditto call was uncached and my snippet one too, i've tried to cache the snippet call in the chunk (have emptied the site cache of course), the result is quite funny, it echoes the whole Ditto call in the page instead of the snippet one
    instead of
    [!dateDetail!]

    (the anotherToto snippet ) i get
    [!Ditto? &parents=`11` &tpl=`datePageDates` &display=`10` &paginate=`1` &paginateAlwaysShowLinks=`1` &sortBy=`dateDate` &sortDir=`ASC` &dateSource=`dateDate` &dateFormat=`%d / %m / %Y`!]

    what's funny is that Ditto keeps working and the information that comes from datePageDate is well displayed, the only thing is that snippet dateDetail that i can't get working

    maybe it comes from the fact that Ditto evals the whole chunk/tpl as being html + placeholders, but that displaying itself instead of a cached snippet looks funny
    thanks for you help anyway
    have swing


  • virtualbear Reply #5, 1 year, 9 months ago

    Reply
    maybe, to be a bit more precise i should give you the whole code...

    the Ditto call is what is displayed above (uncached, well i nearly always use Ditto uncached...)

    the pageDatePages chunk (cached here)
    <div class="uneDate">
        <p class="dateTitre">[+date+] - [+dateLieu+]</p>
        [[dateDetail]]
    </div>

    when dateDetail is uncached, the page displays the snippet call, when cached, it displays the Ditto call...
    thanks again for taking time to answer
    have swing


  • neoziox Reply #6, 5 months, 3 weeks ago

    Reply
    Someone have a answer?


  • dlolsen Reply #7, 3 months, 3 weeks ago

    Reply
    Bump!

    I'm have this weird issue too!