We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Hello,

    I have a radio TV, if it’s set to 1 it displays a snippet, if set to 0 it does not. It does work, however the snippet itself loads JS files so they shouldn’t in my mind load at all if the TV is set to 0. The snippet output does not show the markup but the JS files still load to the dom which I think is wrong.

    Any info would be great.

    Thanks.

    Happens with revo 2.1.2 and 2.1.3
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 4172
      • 5,888 Posts
      some code?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Oops...

        [[*showSlider:is=`1`:then=`
        	      <div id="main-slider-holder">     
        		  <section id="main-slider" class="main-slider">
        			  [[!myGallery? &tpl=`sliderGallery` &albums=`3` ]]
        		  </section>
        	      </div>
        	      <div class="clearfix"></div>
        	    `]]


        I tried :else=`` on the end which had no effect.
          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart
          • 4172
          • 5,888 Posts
          this will run the snippet at parsing time, only doesn’t print the output.

          Did you try to put the snippet-tag in a chunk?
          If that doesn’t help you can create a snippet, which uses $modx->runSnippet in the case when showslider==1

          And I would use :else=`` in any case!

          or make your showslider-tv a checkbox with input-options:
          show slider==[[!myGallery? &tpl=`sliderGallery` &albums=`3` ]]

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!