We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11858
    • 130 Posts
    I have some documents in a ditto call that are "shown in menu" and some that are not. I’d like the items that are ticked "shown in menu" to become links so you can get to the page, and the others that are not ticked just to show in the results. I have a phx call:


    [+phx:if=`[*showinmenu*]`:is=`1`:then=`{{Chunk}}`:else=`{{OtherChunk}}`+] 
    


    Does anyone know what the correct placeholder is for "show in menu" ?

    Cheers!
      • 4172
      • 5,888 Posts
      try
      [+hidemenu:is=`0`:then=`{{Chunk}}`:else=`{{OtherChunk}}`+] 
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 11858
        • 130 Posts
        Thanks Bruno that works great - but it’s created another problem!

        Now, for some reason, the introtext placeholder doesn’t work in either template, even though the pagetitle placeholder does! very weird. I’ve tried [+content+], that also doesn’t work (displays blank like introtext) but I tried [+id+] and that displayed the ID fine. Bizarre. My ditto call looks like this:
        [!Ditto? &parents=`[*id*]` &tpl=`campratesTableCatTplMasonryInit` &sortBy=`menuindex` &sortDir=`ASC`!]
        


        campratesTableCatTplMasonryInit looks like this:
        [+hidemenu:is=`0`:then=`{{campratesTableCatTplMasonryLink}}`:else=`{{campratesTableCatTplMasonry}}`+] 
        


        campratesTableCatTplMasonry looks like this
        <div class="masonryBoxSub">
        <h4>[+pagetitle+]</h4>
        <p>[+introtext+]</p>
        </div>
        


        and campratesTableCatTplMasonryLink looks like this:
        <div class="masonryBoxSub">
        <h4><a href="[~[+id+]~]">[+pagetitle+]</a></h4>
        <p>[+introtext+]</p>
        </div>
        


        Is this the correct way to call the ditto call with phx?
          • 4172
          • 5,888 Posts
          Ditto can’t see these placeholders in your chunks, I think and does not retrieve this fields.
          But you can use &hiddenfields or &hiddenFields to get them.

          Or try:

          <div class="masonryBoxSub">
          [+hidemenu:is=`0`:then=`
          <h4><a href="[~[+id+]~]">[+pagetitle+]</a></h4>
          `:else=`
          <h4>[+pagetitle+]</h4>
          `+] 
          <p>[+introtext+]</p>
          </div>
          

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 11858
            • 130 Posts
            Brilliant bruno, I used your code above and added &hiddenFields=`pagetitle,id` to the Ditto call and it worked.

            Thanks very much!