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

    i have a question about the phx and the templates. I have a ditto call like this [!Ditto? &startID=`121` &tpl=`picturesList`!] That works fine. (1.)



    I click on a pictures , the document open in my template i have created. (2.)

    I have in the document some Template Variables. Example like this:
    Template Variables

    TV01 = Textfield
    TV02 = Textfield
    TV03 = images
    TV04 = images

    In a Document i call the content: [+content+] and PHX like this [+TV01:isnot=``:then=`[+TV01+]`+]
    In the Template i call the content [*#content*] and PHX?

    What is the code in the Template to works in the Template? I have try and try, but nothing does works...

    [*#TV01:isnot=``:then=`<div>[*TV01*]</div>`*]
    [*TV01:isnot=``:then=`<div>[*TV01*]</div>`*] and many ohter variants...

    I will show only the TV01 - 04 if has content.

    Can me someone help me....?
      • 26931
      • 2,314 Posts
      Hi wavetraxx,

      try:
      [+phx:if=`[*TV01:len*]`:gt=`10`:then=`<div>[*TV01*]</div>`:else=``+]


      http://modxrules.com/articles/hide-empty-sections-with-phx
        • 26931
        • 2,314 Posts
        and if you got a greater (uncertain) number of image TVs, it’s probably better to use MaxiGallery to generate the output
          • 26931
          • 2,314 Posts
          btw.
          gt=`10`
          will show your div if the content of TV01 has more than 10 characters
          gt=`0`
          will show it with even 1 character in it..