We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40169
    • 16 Posts
    <div class="container content-md">
    			<div class="row service-block-v6">
    				<div class="col-md-4 md-margin-bottom-50">
    		....
    				</div>
    				<div class="col-md-4 md-margin-bottom-50">
    			....
    				</div>
    				<div class="col-md-4">
    					<i class="icon-custom rounded-x icon-color-u icon-line icon-screen-tablet"></i>
    				....
                        
    				</div>
    			</div><!--/end row-->
    
    			<hr>
    
    			<div class="row service-block-v6">
    				<div class="col-md-4 md-margin-bottom-50">
    					
              ...
    				</div>
    				<div class="col-md-4 md-margin-bottom-50">
    			...
    				</div>
    				<div class="col-md-4">
    			...
    				</div>
    			</div><!--/end row-->
        </div>

    This is my template html code. I have a problem how with getResource transform this code in my modx template.

    I made the code for first part (until "hr") like this:

    Chunk "items":
    [[getResources?
    &tpl=`Temp`
    &tpl_3=`Temp-3`
    &parents=`[[+idnumber]]`
    &limit=`3`
    &depth=`0`
    &includeTVs=`1`
    &showHidden=`1`
    &includeContent=`1`]]

    Temp:
    <div class="col-md-4 md-margin-bottom-50">
    ....
    </div>
    Temp-3:
    <div class="col-md-4">
    ....
    </div>

    TemplateModx:
    <div class="row service-block-v6">
    [[$items]]
    </div>

    Now I have a problem with second part after "hr". How add "hr" and div with class for my next resources.

    If you have any idea please help

    BR
      • 17301
      • 932 Posts
      Not entirely sure I understand what you're trying to do but it sounds like you're trying to put the entire thing as a chunk but with a <hr> in the middle?

      You should be able to do it all in one chunk just set a class on the <div> before you want the <hr> to appear and then use CSS to do a :after{} selector on that class. No one really uses <hr> anymore.

      [ed. note: lkfranklin last edited this post 10 years ago.]
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 52064
        • 120 Posts
        personally I would use one template and width placeholders of getResources check if the resource is even or odd, add "<hr>"


        you can find more information
        https://rtfm.modx.com/extras/revo/getresources
        https://rtfm.modx.com/extras/revo/if
        https://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)
          FerX - Developer at Eracom s.r.l.
          • 40169
          • 16 Posts
          Thanks for the answers.
          I used the tpl_nN Template Properties:

          [[getResources?
          &tpl=`Temp`
          &tpl_n3=`Temp-3`
          &tpl_n4=`Temp-4`
          &parents=`[[+stevilka]]`
          &limit=`6`
          &depth=`0`
          &includeTVs=`1`
          &showHidden=`1`
          &includeContent=`1`

          ]]

          Temp-3
          <div class="col-md-4">
          ....
          </div>

          Temp-4
          <div class="clearfix"></div>
          <hr/>
          <div class="col-md-4 md-margin-bottom-50">
          ....
          </div>

          ---------------------------------------------------------------------------------------
          I have one more question. Is it possible with getResource read filename from specific directory and added to getResourceTemp.

          Temp:
          <div class="item">
          <img class="lazyOwl img-responsive" data-src="[[/img/FILENAME]]">
          </div>

          BR
            • 5430
            • 247 Posts
            Not out of the box, you'd have to write up a little snippet to read the directory/file and return the name.