We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15577
    • 10 Posts
    Hi,

    I dont know how to explain this is a good way, so I have created a image to explain.


    I want to mage the front page as a container, and put elements on the front page as new documents inside the front page document..
    Is this possible? Cant figure out how..
      • 29019 ☆ A M B ☆
      • 104 Posts
      That isn’t too hard to accomplish. You can do it using getResourceField if you don’t plan on changing the documents, or getResources if you do.

      For getResources, try something like this in your home page template:

      <div class="header">...</div>
      <div class="slider">...</div>
      <div class="top-area">
      	[[getResources?
      		&parents=`middle-container-id`
      		&tpl=`home-page-document`
      		&depth=`0`
      		&limit=`0`
      		&includeContent=`1`
      		&sortby=`menuindex`
      		&sortdir=`menuindex`
      	]]
      </div>
      <div class="bottom-area">
      	[[getResources?
      		&parents=`bottom-container-id`
      		&tpl=`home-page-document`
      		&depth=`0`
      		&limit=`0`
      		&includeContent=`1`
      		&sortby=`menuindex`
      		&sortdir=`menuindex`
      	]]
      </div>


      Make sure you replace "bottom-container-id" and "middle-container-id" with the respective document ids. Then for your "home-page-document" chunk, you just do something like this:

      <div class="home-page-document-wrapper">[[+content]]</div>


      Obviously that wrapper div is optional, but that should get you started.
        www.darkstardesign.com

        Are you in the Nashville area? Join us for our next MODX meetup!
        • 15577
        • 10 Posts
        Thanks for the help.
        But when i use the code under, it dont works. I have installet getResourceField and getResource.
        		[[getResources?
        			&parents=`1`
        			&tpl=`home-page-document`
        			&depth=`0`
        			&limit=`0`
        			&includeContent=`1`
        			&sortby=`menuindex`
        			&sortdir=`menuindex`
        		]]

        		[[getResources?
        			&parents=`1`
        			&tpl=`1`
        			&depth=`0`
        			&limit=`0`
        			&includeContent=`1`
        			&sortby=`menuindex`
        			&sortdir=`menuindex`
        		]]


        The Frontpage have ID 1
          • 29019 ☆ A M B ☆
          • 104 Posts
          On your diagram you had the front page, then under that a "middle container" and a "bottom container". You want to use the IDs of those two documents, not the ID of the front page.
            www.darkstardesign.com

            Are you in the Nashville area? Join us for our next MODX meetup!
            • 29019 ☆ A M B ☆
            • 104 Posts
            Oh and you may want to change your "sortdir" argument in getResources to "asc", not "menuindex" - typo, sorry!
              www.darkstardesign.com

              Are you in the Nashville area? Join us for our next MODX meetup!