We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30319
    • 406 Posts
    How does one do this with an output modifier??

    if isempty template_variable do not display specific text
    aka don't output snippet/chunk text if TV empty??

    Would it be
    [[*template_variable:notempty=`text to display`]] ??


    Ideally I need this to work per-page -- one page might have TV values, another one might not, all the pages use the same TV...

    Thank you, Tom [ed. note: TomMLS last edited this post 12 years, 2 months ago.]
    • This should work, what is the value of the TV?

      It seems you might be better off with a Listbox TV with Yes/No options, unless the TV is used for something else.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 30319
        • 406 Posts
        It's a MIGX template variable containing a list of values: image, alt/title text, description text, for a slideshow.

        Don't want people to have to futz around with copy/paste a text thing if I don't have to...

        Thank you, Tom
          • 30319
          • 406 Posts
          I did

          [[*slideshow:notempty=`<div id="myCarousel" class="carousel slide">
          <div class="carousel-inner">
          [[!getImageList? &tpl=`slideshow` &tvname=`slideshow`]]
          </div></div><!-- final carousel div -->`]]
          


          and it seems to work properly -- at least in initial testing, anyway smiley

          Will update this thread when I know for sure...

          Thank you, Tom
            • 30319
            • 406 Posts
            Further testing shows this works...odd thing is that images don't display properly in the MIGX section but they DO display properly in the browser / frontend and that matters!!

            Thank you, Tom