We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    I'm trying to nest get resources, but it's behaving very strangely. Basically I'm trying to build a series of bootstrap carousels based on a resource structure like:


    >WEB
    >HOME
    >ABOUT
    >SALON
    ->CAROUSEL 1
    -->SLIDE 1
    -->SLIDE 2
    -->SLIDE 3
    ->CAROUSEL 2
    -->SLIDE 1
    -->SLIDE 2
    -->SLIDE 3
    ->CAROUSEL ...etc...



    The content of the SALON page calls the immediate children
    <div class="wrapper content">
      
      <div class="container">
    	
    	<div class="row">
    	  
    	  <div class="col-md-12">
    
    		[[!getResources? 
    				&tpl=`salonTpl`  
    				&sortdir=`asc`  
    				&includeTVs=`1`  
    				&processTVs=`1`  
    				&depth=`1`]]
    		
    	  </div>
    	  
    	</div>
    	
      </div>
    
    </div>


    The salonTpl
    <div id="myCarousel-[[+id]]" class="carousel slide salon-content" data-ride="carousel">
    
    	<div class="carousel-inner"><a name="anchor[[+id]]" ></a>
    	
    		[[!getResources?  
    				&resources=`[[+id]]`  
    				&parents=`[[+id]]`  
    				&tpl=`previewTpl`  
    				&tplFirst=`previewFirstTpl`  
    				&sortdir=`asc` &includeTVs=`1`  
    				&processTVs=`1`]]
    	
    	</div>
    	
    	<a class="left carousel-control" href="#myCarousel-[[+id]]" data-slide="prev">
    	<span class="glyphicon glyphicon-chevron-left"></span></a>
    	
    	<a class="right carousel-control" href="#myCarousel-[[+id]]" data-slide="next">
    	<span class="glyphicon glyphicon-chevron-right"></span></a>
    
    </div>


    & the previewTpl
    <div class="[[+tv.SalonImageAlign]] item">
      
      [[+tv.previewImage]]
    
      <div class="carousel-caption [[+tv.SalonImageAlign]]">
    	
    	<h1>[[+pagetitle]]</h1>
    
    	<p>[[+introtext]]</p> 
    	
      </div>
      
    </div>




    I cannot seem to get the [[+tv.SalonImageAlign]] to display at all, I've double checked everything, it has a name value etc. If i remove the tpl values from the getresources call it DOES appear in the raw dump.


        [tpl] => 
        [tplOdd] => 
        ... etc ...
        [properties] => 
        [tv.previewImage] => 
        [tv.SalonImageAlign] => left




    Any idea what is going on here?
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 4172
      • 5,888 Posts
      [[+tv.previewImage]]


      is working, but not

      [[+tv.SalonImageAlign]]


      ?

      And I think, you should remove
      &resources=`[[+id]]` 
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Be sure to call both of those getResources calls cached as well (see these caching guidelines), that may actually be part of your problem but at the very least a very non-performant thing to do.
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 26503
          • 620 Posts
          Yes, exactly, tv.previewImage works [input/output type = image] & tv.SalonImageAlign [i/o type = 'default] does not...!?

          If I remove the resources=`[[+id]]` then the parent item ->CAROUSEL 1/2/3/etc does not display [it is a slide as well.]

          @Mark Hamstra - I tried calling uncached, no difference. sad


          Quote from: Bruno17 at Feb 05, 2014, 12:33 AM
          [[+tv.previewImage]]


          is working, but not

          [[+tv.SalonImageAlign]]


          ?

          And I think, you should remove
          &resources=`[[+id]]` 
            *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

            Sean Kimball CLP, CLS.
            Technical Director / Sr. Developer | BigBlock Studios
            ._______________________________________________.
            Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
            27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
            phone/fax: 905-426-5525
            • 4172
            • 5,888 Posts
            what happens, when you give the inner getResources-call another tvPrefix?

            [[!getResources? 
              &resources=`[[+id]]` 
              &parents=`[[+id]]` 
              &tpl=`previewTpl` 
              &tplFirst=`previewFirstTpl` 
              &sortdir=`asc` &includeTVs=`1` 
              &processTVs=`1`
              &tvPrefix=`innertv.`
            ]]


            and try it with

            [[+innertv.SalonImageAlign]]
            [[+innertv.previewImage]]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!