Knowledgebase: Step by Step Guides
Add Template Fields
Posted by - NA -, Last modified by Mark [Elevated X Support] on 22 April 2015 01:25 PM

Add Template Fields

Template fields allow you to insert custom variable tags into your pages. This is useful for adding elements that you may need to change without wanting to edit the templates each time. Examples might be a contact email address or a banner image or link code.

Step 1) Log into your cms admin panel and click Plug-Ins and then Manage Template Fields. Here you can specify a custom field that can be edited via the admin panel. Assign a name and enter a value for the contents of the field.

Step 2) In order for the contents of the field to be displayed on a site you must first add the new variable tag to your template in each location you want the field to appear.

If You Use XSL Templates:

Step 1) Paste the following tag into an XSL template and replace TITLEHERE with the title/name you assigned to the template field in the admin panel.

<xsl:value-of disable-output-escaping="yes"
select="/root/page/templateconf/TITLEHERE" />

NOTE - This functionality is intended for advanced users and those who are comfortable editing the XSL templates. When working with your templates please make a backup copy of the template folder(s) prior to editing as we do not have a copy of your files.

If you Use Smarty Templates:

Step 1) Paste the following tag into a Smarty template and replace TITLEHERE with the title/name you assigned to the template field in the admin panel

{$templateconf.TITLEHERE}

Use of our tech support staff for assistance with advanced features such as template fields may result in additional support charges or estimates for custom coding.

If you use PHP Templates

 

Step 1) Paste the following tag into a PHP template and replace TITLEHERE with the title/name you assigned to the template field in the admin panel

 

<?= $templatefields["TITLEHERE"] ?>

 

Use of our tech support staff for assistance with advanced features such as template fields may result in additional support charges or estimates for custom coding.

 

(4 vote(s))
Helpful
Not helpful

Comments (0)