We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38855
    • 16 Posts
    I don`t know, this could be maybe a simple question but I'm newbie using MODX the thing is that I want to show or hide some divs on my tamplate based on the values of my TV so I want to do someting like this
    if (my_TV(is filled)) {
    show my div
    } else { hide my div; }
    So my cuestion to you guys i'ts if there's any way to do that in my templates
    Thanks for your attention and I really hope you can help me.
      • 29076
      • 615 Posts
        I think, thererfor I am! But what I am, and why...?
        • 33968
        • 863 Posts
        Or...
        [[*myTV:notempty=`<div>My Div</div>`]]
        

        http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
          • 29076
          • 615 Posts
          Quote from: okyanet at Feb 29, 2012, 03:11 AM
          Or...
          [[*myTV:notempty=`<div>My Div</div>`]]
          

          http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
          Nice. Thanks. smiley
            I think, thererfor I am! But what I am, and why...?
            • 38855
            • 16 Posts
            Thanks guys it worked smiley
              • 38855
              • 16 Posts
              what if I'm using getresourses to display an article list?
              my code is this:
              <div id="rg-gallery" class="rg-gallery">
              					<div class="rg-thumbs">
              						<div class="es-carousel-wrapper">
              							<div class="es-nav">
              								<span class="es-nav-prev">Previous</span>
              								<span class="es-nav-next">Next</span>
              							</div>
              							<div class="es-carousel">
              								<ul>
              									[[!getImageList:default=`No images found`?
                  								&tvname=`galeria`
                  								&tpl=`galthumb`
                  								&outputSeparator`galcont` ]]
              								</ul>
              							</div>
              						</div>
              					</div>
              				</div>

              But I don't want to display the hole div#rg-gallery if my TV's are empty, so using [[*myTV:notempty=`<div>My Div</div>`]] it only hides the <li> of my list but I cant hide the container div.