We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42963
    • 12 Posts
    I have two boxes in my template both are read in from within the template with this code:

    Orange Box
    [[!getResources? &resources=`4` &tpl=`Infobox_orange` &showHidden=`1` &includeTVs=`1` &processTVs=`1`]]

    Green Box
    [[!getResources? &resources=`6` &tpl=`Infobox_gruen` &showHidden=`1` &includeTVs=`1` &processTVs=`1`]]

    Now I want them only to be displayed if their TV (checkbox) is set to "1"
    I tried already tvFilters like this
    [[!getResources? &resources=`6` &tpl=`Infobox_gruen` &showHidden=`1` &includeTVs=`1` &processTVs=`1` &tvFilters=`ZeigeBox==1`]]

    but I did not get it to work yet.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Put your getResources into chunks, then have the input options of your TV be
      Orange==[[$orangeChunk]]||Green==[[$greenChunk]]


      Output modifiers can also do the job. Again, putting the getResources call in a chunk makes it easier. Something like this
      [[[[*ZeigeBox:is=`orange`:then`$orangeChunk`:else=`$greenChunk`]]]]


      [ed. note: sottwell last edited this post 12 years, 11 months ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 42963
        • 12 Posts
        Thank you so far..
        Hm.. I had the call for the Boxes in the Template and then tried to read out the resources box_green and box_orange. Both had a tv named ZeigeBox. And I tried to set up the display options from there..
        Well.. I might need to set it up completely different.
          • 4172
          • 5,888 Posts
          with the TV 'ZeigeBox' on the Resources 4 and 6 and

          &tvFilters=`ZeigeBox==1`


          you can view/hide the output at all on all pages.
          Is it this what you want?

          Or do you want to set show/hide - status of the different boxes for each Resource individual?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 42963
            • 12 Posts
            well, that is what I need and I also tried it, but somehow it did not work
              • 18817 ☆ A M B ☆
              • 205 Posts
              I'm working on something similar, if anyone has a suggestion to get it working properly.

              Background
              I'm creating a case studies landing page that will have tabbed content. Within each tab is a 'practice' for the company (app development, design, salesforce, support). I created a TV called "Capabilities" with an input option of Check Box. The user will then select which practices are relevant for the case study; including an additional option; a TV called "Featured".

              My Setup
              I have a Template with multiple getResources calls (inside each 'tab') to aggregate the case studies in the respective practice.

              The Issue
              Those marked with Featured == yes are showing up. If I select one of the capabilities (design) it shows up in it's respective tab. If I select more than one capability (design, app dev), then no results are listed.

              Le Code
              Template
              <div class="row" id="tabs">
              	<div class="large-12 columns">
              	  <div class="section-container auto" data-section>
              		  <section class="active">
              			  <p class="title" data-section-title>
              				  <a href="#panel1">Featured</a>
              			  </p>
              			  <div class="content" data-section-content>
              				  <div class="row">
              				  	[[!getResources:default=`No results found`? 
              						&parents=`2` 
              						&tpl=`CaseStudyTpl`
              						&tplFirst=`CaseStudyFirstTpl`
              						&tplLast=`CaseStudyLastTpl`
              						&limit=`8`
              						&sortby=`menuindex`
              						&tvFilters=`Featured==yes`
              						&processTVs=`1`
              						&includeTVs=`1`
              						&tvPrefix=``
              					]]
              				  </div>
              			  </div>
              		  </section> <!-- END section -->
                
              		  <section>
              			  <p class="title" data-section-title>
              				  <a href="#panel2">Application Solutions</a>
              			  </p>
              			  <div class="content" data-section-content>
              				  <div class="row">
              				  	[[!getResources:default=`No results found`? 
              						&parents=`2` 
              						&tpl=`CaseStudyTpl`
              						&tplFirst=`CaseStudyFirstTpl`
              						&tplLast=`CaseStudyLastTpl`
              						&limit=`8`
              						&sortby=`menuindex`
              						&tvFilters=`Capabilities==appsol`
              						&processTVs=`1`
              						&includeTVs=`1`
              						&tvPrefix=``
              					]]
              				  </div>
              			  </div>
              		  </section> <!-- END section -->
              
              		  <section>
              			  <p class="title" data-section-title>
              				  <a href="#panel3">Digital Marketing & Design</a>
              			  </p>
              			  <div class="content" data-section-content>
              				  <div class="row">
              				  	[[!getResources:default=`No results found`? 
              						&parents=`2` 
              						&tpl=`CaseStudyTpl`
              						&tplFirst=`CaseStudyFirstTpl`
              						&tplLast=`CaseStudyLastTpl`
              						&limit=`8`
              						&sortby=`menuindex`
              						&tvFilters=`Capabilities==digital`
              						&processTVs=`1`
              						&includeTVs=`1`
              						&tvPrefix=``
              					]]
              				  </div>
              			  </div>
              		  </section> <!-- END section -->
              
              		  <section>
              			  <p class="title" data-section-title>
              				  <a href="#panel4">Salesforce</a>
              			  </p>
              			  <div class="content" data-section-content>
              				  <div class="row">
              				  	[[!getResources:default=`No results found`? 
              						&parents=`2` 
              						&tpl=`CaseStudyTpl`
              						&tplFirst=`CaseStudyFirstTpl`
              						&tplLast=`CaseStudyLastTpl`
              						&limit=`8`
              						&sortby=`menuindex`
              						&tvFilters=`Capabilities==salesforce`
              						&processTVs=`1`
              						&includeTVs=`1`
              						&tvPrefix=``
              					]]
              				  </div>
              			  </div>
              		  </section> <!-- END section -->
              
              		  <section>
              			  <p class="title" data-section-title>
              				  <a href="#panel2">Support Solutions</a>
              			  </p>
              			  <div class="content" data-section-content>
              				  <div class="row">
              				  	[[!getResources:default=`No results found`? 
              						&parents=`2` 
              						&tpl=`CaseStudyTpl`
              						&tplFirst=`CaseStudyFirstTpl`
              						&tplLast=`CaseStudyLastTpl`
              						&limit=`8`
              						&sortby=`menuindex`
              						&tvFilters=`Capabilities==clientcare`
              						&processTVs=`1`
              						&includeTVs=`1`
              						&tvPrefix=``
              					]]
              				  </div>
              			  </div>
              		  </section> <!-- END section -->
                
              	  </div><!-- END .section-container -->
              	</div>
                </div>


              Need anything else? Let me know. Thanks for reviewing!
                Sal Baldovinos
                SEO & DIGITAL MARKETING

                ARIEL DIGITAL | Maximize Your Potential
                www.arieldigitalmarketing.com
                • 3749
                • 24,544 Posts
                How are you "selecting" the capabilities?
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 18817 ☆ A M B ☆
                  • 205 Posts
                  It's a check box TV
                  Quote from: BobRay at Oct 30, 2013, 06:04 PM
                  How are you "selecting" the capabilities?
                    Sal Baldovinos
                    SEO & DIGITAL MARKETING

                    ARIEL DIGITAL | Maximize Your Potential
                    www.arieldigitalmarketing.com
                    • 3749
                    • 24,544 Posts
                    In that case, the value of the TV is not going to be equal to any of the TvFilter values when it contains more than one item.

                    You could do it with three checkbox, radio, or Yes/No TVs.

                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 18817 ☆ A M B ☆
                      • 205 Posts
                      Hmmmm

                      What I'm trying to achieve is one case study can live in multiple 'capabilities'.

                      So, in the tab that is only for App Dev, only App Dev case studies show, but some of those case studies could also live under Digital... follow?

                      Quote from: BobRay at Oct 30, 2013, 06:11 PM
                      In that case, the value of the TV is not going to be equal to any of the TvFilter values when it contains more than one item.

                      You could do it with three checkbox, radio, or Yes/No TVs.

                        Sal Baldovinos
                        SEO & DIGITAL MARKETING

                        ARIEL DIGITAL | Maximize Your Potential
                        www.arieldigitalmarketing.com