We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Creating your own multipart webpage template with MODx is very easy and straight forward. By using a few documents and a few template variables you can create a web template that dynamic and easy to update.

    Let?s consider a regular 3-column layout. The left-column is used to store the navigation bar, the middle column is used to display the content of the current document and the right-column is used to display special items.

    The first thing we will do is to use an html editor to create a 3-column table or CSS layout and save it as a template (e.g. Multipart Template). Next we will create two new documents and save them as ?My Left Sidebar? and ?My Right Sidebar?. The saved documents should be published. These documents will be used to store the content of the left and right columns of our webpage.

    The next few steps will enable us to add the content of these two documents to our multipart template:

    1. Create a template variable called MyLeftColumn and enter @DOCUMENT 4 inside the default value text field. Here we assume ?4? to be the id number of the document called ?My Left Sidebar.? You should replace ?4? with the correct id number of your document|

    2. Assign the template variable to the ?Multipart Template? we have created above.

    3. Save the template variable.

    4. Create another template variable called MyRightColumn and enter @DOCUMENT 5 inside the default value text field. Here again we assume ?5? to be the id number of the document called ?My Right Sidebar.? You should replace ?5? with the correct id number of your document.

    5. Assign the template variable to the ?Multipart Template? we have created above.

    6. Save the template variable.

    7. Next we need to edit the template called ?Multipart Template? and add the [*MyLeftColumn*] variable to the left-column of the page and the [*MyRightColumn*] variable to the right-column.

    8. Save the template.

    That?s it! We successfully linked the documents to the left and right columns of the template. We can now make changes to documents and have those changes appear either inside the left or right columns of our web page.

    With the our new multipart template we can modify the document entitled ?My Left Sidebar? to display a menu with image, ads, etc while using the document entitled ?My Right Sidebar? to display specials, new items, latest news, etc.

    The cool thing about this design is that we can easily change the left and right columns for a specific document without affecting other documents or having to create new template smiley

      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 33337
      • 3,975 Posts
      laugh Thanks for nice tip !!!

      Best regards,

      zi
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • Just out of curiosity, is there any reason that you could not accomplish the same thing with Chunks for the right and left columns?
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 32963
          • 1,732 Posts
          Sure you can use Chunks for the right and left coloumns but the TVs are more flexible. For example, to change the right column you would have to edit the template or create a new one. but with the TV all you have to do is change it’s value.

          You would also use the @CHUNK binding to bind the TV to a chunk rather than a document.

            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
          • Doing it as a TV also allows you to use the Rich Text editors for more of a WYSIWYG experience.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 6661
              • 119 Posts
              Hmmm,

              Sounds like a cool idea to me smiley
                • 30095
                • 9 Posts
                Tnx. Works fine
                  • 4266
                  • 70 Posts
                  Quote from: xwisdom at May 27, 2005, 10:16 PM

                  The cool thing about this design is that we can easily change the left and right columns for a specific document without affecting other documents or having to create new template smiley
                  Sorry, may be I had not catch something undecided, but both right- and left-side-coloumn content automaticaly displays on all pages with this 3-coloumns template. So, I can’t change the left and right columns for a specific document without affecting other documents. In order to do that I need to create another set of TVs for each document types. Please, clear this topic to me  rolleyes
                    • 32963
                    • 1,732 Posts
                    Quote from: bugaev at Sep 12, 2005, 12:50 PM

                    Sorry, may be I had not catch something undecided, but both right- and left-side-coloumn content automaticaly displays on all pages with this 3-coloumns template. So, I can’t change the left and right columns for a specific document without affecting other documents. In order to do that I need to create another set of TVs for each document types. Please, clear this topic to me  rolleyes

                    If you make the change from the withing the Default Value of the TV then it will affect all pages. You should only make the change from when editing the document
                      xWisdom
                      www.xwisdomhtml.com
                      The fear of the Lord is the beginning of wisdom:
                      MODx Co-Founder - Create and do more with less.
                      • 20078
                      • 2 Posts
                      But is there any way to make one of the sidebars editable with quickedit and unique for each page? I mean, what if I want my right sidebar to contain lists and other information that will be different depending on the content of the central area? Without creating a new template for each, is there a way to do this?

                      -Thanks for your help.