Developer Guide

Template Cutin Guide

Overview Uploading a Template layouts sub-page template <$headerplugins> $logo1 <$menu> <$pagetitle> <$body> <$section> <$blog> <$sidebarcontrol> <$sidebarmenu> $single <$snippet> <$include> edittext label $viewlink <$cartitems> <$carttotal> <$domain> <$userfullname> <$userid> <isHomePage> <IsNotHomePage> <else> logic options <$copyright> <$trademark> <$date> <$year> File Versioning Social Media Links

<$snippet>

Macro<$snippet>
Purpose A snippet is a re-usable block of HTML code that can be included in another location of the main or sub-template so you only have to code the section once.

Consider your home page template. It will have a header and footer that may be identical to the header and footer in your sub-page template. So you can create a snippet of these and other sections, and include them in your sub-page template.
Special NotesThis macro must be closed with a <$/snippet> macro.
Attributes
  • name - Required, the name of the snippet
Example Usage

HOME PAGE TEMPLATE

Header...

Body...

<$snippet name="footer">
<div id="footer">
   Footer content
</div>
</$snippet>


SUB_PAGE TEMPLATE

Header...

Body...

<$include snippet ="footer">


This macro also has a shortcut:

<div id="footer" $snippet="footer">
   Footer content
</div>

<div id="footer">
   <$include snippet ="footer">
</div>

Using the snippet tag like this creates the snippet from the contents of the HTML tag it is inserted into, here the DIV. Notice here that the footer DIV is still included as the snippet was created from the content of the DIV excluding the DIV itself. So we need to place the $include tag inside the DIV, wheras with the above example, the snippet macro enclosed the entire footer including the footer DIV.