Lesson 2: Templates and Template Variables

Templates

A template is the layout of the website – one advantage of ModX is that it is not necessary to alter or even view the template in order to change the words on the site.

This site uses just three templates at this time:

  1. a red and grey template - including a special template for the front page ("Red index")
  2. a blue and white template ("blue")
  3. a blue and content-rich template (alot) - including a special stripped template for pages that need more space ("a little of alot")

Then there are two special templates which are always in a site:

  1. a blank page (blank)
  2. the “Minimal Template” that came with the program, developed by the fine people at ModX.

Imagine the possibilities and ways in which you could quickly change themes on your own website with different templates for different parts of your site or for the different seasons or events.

The templates are changed quickly and easily with the “Uses Template” choice when editing a page. To try it out, open your "My Page" and use the dropdown to choose a different template. Note that the "Red Index" Template won't work for this.

Template Variables

However, sometimes it is nice to be able to alter the template slightly and, for that, we use Template Variables. On our UltraTrendy demo site, we have identified four areas of the template that can be modified. These are shown on the bottom-right area of each page. Modifications occur at a page level – so you can make different choices for each page.

For our Red Template, the variables show down the left side, in the red column:

  1. logo – image

  2. sidebar - image

  3. your company name – text

  4. address – multi-line text

To change an image, click “insert” and browse for an appropriate image.
To change the text, just type!

Please practise by changing the images and text for all four template variables.

Then follow the Steps 7-9 from Lesson 1 to save and view your changes.

 

Developer Tips

  • Get Found

    SEO or Search Engine Optimization, is the art of ensuring that your site shows up as one of the first results on popular search engines (like Google).   More…

  • Be Flexible

    Know your audience. Will they always be visiting from a high-powered, big bandwidth computer with a great monitor or is it necessary to consider the lower-tech users? What about Blackberry and iphone users?   More…

     

Our Products

Orbit Consulting can provide the entire range of services for your web site - from graphic design to custom database programming.

We can provide a high level of interactivity between you and your customers with

  • Forums
  • Blogs
  • Wikis
  • RSS Feeds
These technologies can increase customer loyalty and return visits to your site.