We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6561
    • 139 Posts
    I’d like to add some HTML code in my template, a quote that sits below images. But, if nothing is filled in, the code should not be generated.

    For example:
    PlaceHolder: QuoteForImage
    In template:
    <blockquote>[*QuoteForImage*]</blockquote> 


    I messed around with TV and chunks, but if the field is empty it outputs:
    <blockquote></blockquote>


    And I would like it to output nothing if field is left empty (empty by default).


      • 22770
      • 285 Posts
      Use PHx for this. It’s fairly straightforward:

      [*QuoteForImage:isnt:then=`<blockquote>[*QuoteForImage*]</blockquote>`*]
        • 6561
        • 139 Posts
        Quote from: PatrickSamphire at Mar 31, 2009, 05:55 AM

        Use PHx for this. It’s fairly straightforward:

        [*QuoteForImage:isnt:then=`<blockquote>[*QuoteForImage*]</blockquote>`*]


        Is this something already in modx 9.6.3 or do I have to install it?

        EDIT: nevermind, I found it in the ’Extras’
          • 6561
          • 139 Posts
          Hm, just when you think modx couldn’t get cooler cool