We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33657
    • 128 Posts
    Ok so I have a slider, NIVO SLIDER.

    Now when I load slides I have the option to display HTML captions, like this.

    <img src="myimage.jpg" title="#myhtmlcaption" />


    Now the title cooresponds to an ID that contains HTML data, like

    <div id="myhtmlcaption"><strong>Hello</strong></div>

    The problem I am having is, if i use a TV for title I have to load a # in if its not blank, I want to use the same TV for the div ID and the Title, that way they both match up... but obviously one needs a # and one doesn’t. I can’t just do it like this #[[+mytv]] because if I decide I DONT want a caption for that particular slide, I get a blank caption because the # is always loaded in my title, ie: title="#"

    so I want to do this conditianally, like this...

    if caption title != nil then add # in front of caption title tv for the slider and use the same tv minus the # for the div ID, else.. leave em both blank and don’t use a caption.

    any idea’s how to do this? filtering? or etc..
      • 6228
      • 249 Posts
      <img src="myimage.jpg" title="[[*myTv:notempty=`#[[*myTv]]`]]" />
        lo9on.com

        MODx Evolution/Revolution | Remote Desktop Training | Development
        • 33657
        • 128 Posts
        Quote from: cyclissmo at May 29, 2011, 07:58 AM

        <img src="myimage.jpg" title="[[*myTv:notempty=`#[[*myTv]]`]]" />


        super awesome! that did it exactly. love it. I was writing a custom php snippet that transformed it but this is so much better and built in!