Custom Template Tags

From NewHaven Software Wiki

Jump to: navigation, search

About

Template tags are an easy way to allow for editable content on your site without the need to modify your templates. Your site comes with some existing template tags for things like contact forms, how many featured products to display, etcetera --but you can setup your own template tags and use them in any template.

Add Custom Tags

The first step to setup custom tags is to define the name and value for your tags. To do this login to your eCMS control panel and go to Design >> Template Tags. At the top of the screen click on the link Add Tag or Category. There are four fields for a template tag (see image):

  • Name: The name you want to give your tag. This needs to be alpha-numeric, no spaces. You can use an underscore or dash as a space.
  • Description: A description of your template tag. This will show in the admin next to your tag.
  • Value: This is what you want to display in your template or site. You can use HTML here (whitespace will be stripped out).
  • Category: The category you want the tag to belong to.

Using Template Tags

Template tags are simple to add to your templates. Navigate to Design >> Template Library and select the template you wish to add your tag to and click edit. Template tags are specially formatted and look like this: {#tag_name#}.

Personal tools