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