We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30816
    • 26 Posts
    I have two different questions.

    First one:

    Normally when I create new documents I fill introtext and content. My Ditto call shows only introtext.
    Is it possible to make something like this: When introtext is set up then Ditto show Introtext, when in a document only content is set up [introtext is empty], Ditto should show Content ?

    Second question:

    I have structure with documents like this:
    2008 (parent) -> January, February, March .....December
    Each month is also a folder which has docemnts for example
    January ->article1
    ->article2

    On my home page I would show only documents which are inside "months".
    I use this Ditto call

    [!Ditto?parents=`33` &tpl=`news_chunk`&display=`6` &depth=`3` &hideFolders=`1` &paginate = 1 &paginateAlwaysShowLinks= 1!]

    And is a problem, because when my document [this one which should be shown] is a folder [it’s become a folder when someone put come comments]...it’s not shown. I understand this because I use &hideFolders=`1`.
    When I will use &hideFolders=`0` then also Ditto will show 2008, January etc which shouldn’t be shown.


    Anyone could help me?
      • 3707
      • 241 Posts
      For the first question, you could use PHx to check if whether introtext is empty using the ifempty modifier. So in your template chunk you would have something like:
      <h3>[+title+]</h3>
      <p>[+introtext:ifempty=`[+content+]`+]</p>

      Then to enable Ditto to process the nested content placeholder you would have to add a hiddenfields parameter to your Ditto call:
      [!Ditto?parents=`33` &tpl=`news_chunk` &hiddenFields=`content`!]


      For the second question, are you able to uncheck the ’Show in menu’ box for the year and month documents? You could then use the showInMenuOnly parameter in your Ditto call.
        • 30816
        • 26 Posts
        Quote from: bob1000 at Aug 29, 2008, 05:46 AM

        For the first question, you could use PHx to check if whether introtext is empty using the ifempty modifier. So in your template chunk you would have something like:
        <h3>[+title+]</h3>
        <p>[+introtext:ifempty=`[+content+]`+]</p>

        Then to enable Ditto to process the nested content placeholder you would have to add a hiddenfields parameter to your Ditto call:
        [!Ditto?parents=`33` &tpl=`news_chunk` &hiddenFields=`content`!]


        For the second question, are you able to uncheck the ’Show in menu’ box for the year and month documents? You could then use the showInMenuOnly parameter in your Ditto call.


        Thanks for your help. So first question is solved smiley

        For th second question: I can’t uncheck the "Show in menu" because I will use it to generate dynamiccaly menu.
        I was thinking about this solution. But I don’t know if it’s possible to do it. I would like to add TV called "visibiity" when is set on 1 then it should be shown in ditto call where is 0 then is not shown. Very simply, but how to connect it with Ditto?

          • 36592
          • 970 Posts
          Quote from: turli at Sep 01, 2008, 02:04 AM

          I would like to add TV called "visibiity" when is set on 1 then it should be shown in ditto call where is 0 then is not shown. Very simply, but how to connect it with Ditto?
          I think you can use &filter parameter to solve your problem.
            • 30816
            • 26 Posts
            thanks for your help. It works.

            I added &filter=`visibility,2,2` to my ditto call.