Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Directives are meta-data that appears in comments within the template code (typically at the top of the template).   When present, they generate fields that merchants may fill in, allowing them to customize their web site without having to edit code.

directive declares an attribute merchant supplies a value value is available within the template
Image RemovedImage Removed

Image Removed

 

 

Directives break down into several categories.

Tip

The two pound signs (#) in front of each directive example are velocity (our template language) comments. Because the following directives are used by the UltraCart engine and not the velocity template engine, we do not want them read by the velocity engine and rendered as html content. So it's standard practice to list out directives within velocity comments.

Info

The syntax for directives is uc:directive-name="name|default-value". The pipe (delimiter) and default value are almost always optional.

 

Template Capabilities

NameValue 1Value 2DescriptionExample
uc:contains-velocityBoolean Indicates that the template contains Velocity code and should be processed through the Velocity rendering engine## uc:contains-velocity="true"
uc:display-itemsBoolean Indicates that the template can display items## uc:display-items="true"
uc:display-blog-postsBoolean When true, additional features are displayed on page editor allowing the merchant to select blog posts, etc.## uc:display-blog-posts="true"
uc:display-subgroupsBoolean Indicates that the template supports displaying child pages.## uc:display-subgroups="true"
uc:ignore-missing-directivesBoolean 

Useful for instructing the backend editor to not generate input fields for the missing directives used in the template.

For example, some of the document tops access lots of different information that is conditional. We don't want input fields generated for conditional data.

## uc-ignore-missing-directives="true"
uc:page-multimedia-default-used
Boolean true if the default multimedia image is used somewhere on the page 
uc:paginationBoolean Indicates that the template supports paginated display of a large number of items## uc:pagination="true"
uc:page-typeString The type of page. Possible options are:
  • static
  • group
  • item
  • misc
  • customer
  • checkout
  • affiliate
  • email
## uc:page-type="group"

Attributes (Page, Theme, and Site)

Info

Page, theme, and site attributes all function the same. The only difference is the scope.

  • Page attributes are only meant for use on one page.
  • Theme attributes within a particular theme.
  • Site attributes are expected to be used across the entire site.

...

Name

...

Directives are meta-data that appears in comments within the template code (typically at the top of the template).   When present, they generate fields that merchants may fill in, allowing them to customize their web site without having to edit code.

directive declares an attribute merchant supplies a value value is available within the template
Image AddedImage Added

Image Added

 

 

Directives break down into several categories.

Tip

The two pound signs (#) in front of each directive example are velocity (our template language) comments. Because the following directives are used by the UltraCart engine and not the velocity template engine, we do not want them read by the velocity engine and rendered as html content. So it's standard practice to list out directives within velocity comments.

Info

The syntax for directives is uc:directive-name="name|default-value". The pipe (delimiter) and default value are almost always optional.

 

Template Capabilities

NameValue 1Value 2DescriptionExample
uc:contains-velocityBoolean Indicates that the template contains Velocity code and should be processed through the Velocity rendering engine## uc:contains-velocity="true"
uc:display-itemsBoolean Indicates that the template can display items## uc:display-items="true"
uc:display-blog-postsBoolean When true, additional features are displayed on page editor allowing the merchant to select blog posts, etc.## uc:display-blog-posts="true"
uc:display-subgroupsBoolean Indicates that the template supports displaying child pages.## uc:display-subgroups="true"
uc:ignore-missing-directivesBoolean 

Useful for instructing the backend editor to not generate input fields for the missing directives used in the template.

For example, some of the document tops access lots of different information that is conditional. We don't want input fields generated for conditional data.

## uc-ignore-missing-directives="true"
uc:page-multimedia-default-used
Boolean true if the default multimedia image is used somewhere on the page 
uc:paginationBoolean Indicates that the template supports paginated display of a large number of items## uc:pagination="true"
uc:page-typeString The type of page. Possible options are:
  • static
  • group
  • item
  • misc
  • customer
  • checkout
  • affiliate
  • email
## uc:page-type="group"

Attributes (Page, Theme, and Site)

Info

Page, theme, and site attributes all function the same. The only difference is the scope.

  • Page attributes are only meant for use on one page.
  • Theme attributes within a particular theme.
  • Site attributes are expected to be used across the entire site.

 

 

deprecatedMarks an attribute as deprecated to allow the merchant warning that it will disappear in future releasesattributemultiline attributeA multi-line text input field.attributepagecollectionProvides a rich UI widget allowing merchants to select a group of pages for whatever end is desiredattributergbargba color pickerattributesimplelist attributeA simple list allows for a series of information to be configured within an attributeattributeslider attributeProvides a rich UI widget to allow merchants to configure a sliderpage-attribute-stringchild-page this child out many child pages. If the page wishes to show a particular image for each child page, it can specify the code here child page

Name

Value 1Value 2DescriptionExample
uc:page-attribute-booleanName of the attributeDefault ValueA yes/no attribute that appears as a checkbox in the user interface.## uc:page-attribute-boolean="show-comments|true"
uc:page-attribute-colorName of the attributeDefault ValueAn HTML color that displays as a color picker in the user interface 
uc:page-attribute-definitionlistName of the attribute A definition list allows terms/definitions or name/value pair lists to be configured 

uc:page-attribute-deprecated
Name of the attribute Marks an attribute as deprecated to allow the merchant warning that it will disappear in future releases 
uc:page-attribute-htmlName of the attributeDefault ValueA block of HTML. The editor in the user interface is a syntax highlighting editor. 
uc:page-attribute-integerName of the attributeDefault ValueA number input 
uc:page-attribute-itemsetName of the attributeDefault ValueA set of item ids. The input contains a an item search field to make located the items easier. 
uc:page-attribute-multilineName of the attribute A multi-line text input field. 
uc:page-attribute-pagecollectionName of the attribute Provides a rich UI widget allowing merchants to select a group of pages for whatever end is desired 
uc:page-attribute-rgbaName of the attributeDefault Valuergba color picker 
uc:page-attribute-definitionlistsimplelistName of the attribute A definition simple list allows terms/definitions or name/value pair lists for a series of information to be configured within an attribute. 
uc:page-attribute-sliderName of the attribute Provides a rich UI widget to allow merchants to configure a slider 
uc:page-attribute-htmlstringName of the attributeDefault ValueA block of HTML. The editor in the user interface is a syntax highlighting editor.single line text input field 
uc:child-page-
attribute-integer
Name of the attributeDefault ValueA number input uc:page-attribute-itemsetName of the attributeDefault ValueA set of item ids. The input contains a an item search field to make located the items easier.
multimedia-code
Name of the code Instructs the editor that this page uses child images by a certain code. Imagine a catalog page that needs to list out many child pages. If the page wishes to show a particular image for each child page, it can specify the code here. When the merchant edits the child page, a placeholder will be created alerting the merchant that they need to supply that image.  
uc:child-page-multimedia-
code-
deprecated
Name of the code Instructs the editor to display a deprecated warning next to a particular multimedia image, alerting the merchant that the child page's image is no longer in use.  
uc:child-page-multimedia-
default-
Name of the attribute 
used
'true' Instructs the editor that this page uses the default image of each child page, most likely to display a thumbnail of the children. 
uc:page-
description-
Name of the attributeDefault Value
used
'true'  Instructs the editor that the page description is used. 
uc:page-
multimedia-
code
Name of the code Instructs the editor that this page template uses a multimedia image given by a particular code. The editor will display a placeholder for that image to remind the merchant they need to provide an image for proper operation. 
uc:page-
multimedia-code-
deprecated
Name of the code Instructs the editor to display a deprecated warning next to a particular multimedia image, alerting the merchant that the image is no longer in use.  
uc:
Name of the attributeDefault ValueA single line text input field
page-multimedia-default-used
'true' Instructs the editor that this page uses the default image, prompting the merchant to supply a default image. 
uc:
pagecollection-multimedia-code
Name of the code Instructs the editor that each page in a pagecollection uses images by a certain code. Imagine a catalog page that needs to list out a collection of pages. When the merchant edits any page in the pagecollection, a placeholder will be created alerting the merchant that they need to supply that image.  
 
uc:child-pagepagecollection- multimedia-code-deprecated
Name of the codecode  Instructs the editor to display a deprecated warning next to a particular multimedia image, alerting the merchant that the child page's image is no longer in use.  
 
uc:childpagecollection-page-multimedia-default-used
'true'Name of the code  Instructs the editor merchant that this any page uses the default image of each child page, most likely to display a thumbnail of the children. 
uc:page-description-used
'true'  Instructs the editor that the page description is used. 
uc:page-multimedia-code
Name of the code Instructs the editor that this page template uses a multimedia image given by a particular code. The editor will display a placeholder for that image to remind the merchant they need to provide an image for proper operation. 
uc:page- multimedia-codefound in the pagecollection needs to supply a default image.  
 
 
 

...

page multimedia-default-usedInstructs the editor that this page uses the default image, prompting the merchant to supply a default imagepagecollection multimediacode code 

Name

Value 1Value 2DescriptionExample
uc:theme-attribute-booleanName of the attributeDefault ValueA yes/no attribute that appears as a checkbox in the user interface.## uc:theme-attribute-boolean="show-comments|true"
uc:theme-attribute-colorName of the attributeDefault ValueAn HTML color that displays as a color picker in the user interface 
uc:theme-attribute-definitionlistName of the attribute A definition list allows terms/definitions or name/value pair lists to be configured 

uc:theme-attribute-deprecated
Name of the codeattribute Instructs the editor to display a deprecated warning next to a particular multimedia image, alerting the merchant that the image is no longer in use. Marks an attribute as deprecated to allow the merchant warning that it will disappear in future releases 
uc:theme-'true' attribute-htmlName of the attributeDefault ValueA block of HTML. The editor in the user interface is a syntax highlighting editor. 
uc:theme-attribute-integerName of the  Instructs the editor that each page in a pagecollection uses images by a certain code. Imagine a catalog page that needs to list out a collection of pages. When the merchant edits any page in the pagecollection, a placeholder will be created alerting the merchant that they need to supply that image. attributeDefault ValueA number input 
uc:pagecollectiontheme- multimedia-code-deprecatedattribute-itemsetName of the code attribute Instructs the editor to display a deprecated warning next to a particular multimedia image, alerting the merchant that the image is no longer in use.  
 
uc:pagecollection- multimedia-default-used
Name of the code  Instructs the merchant that any page found in the pagecollection needs to supply a default image.  

...

Default ValueA set of item ids. The input contains a an item search field to make located the items easier. 
uc:theme-attribute-multilineName of the attribute A multi-line text input field. 
uc:theme-attribute-pagecollectionName of the attribute Provides a rich UI widget allowing merchants to select a group of pages for whatever end is desired 
uc:theme-attribute-

...

rgbaName of the attributeDefault Valuergba color picker 
uc:theme-attribute-

...

simplelistName of the attribute A simple list allows for a series of information to be configured within an attribute. 
uc:theme-attribute-

...

stringName of the attributeDefault ValueA single line text input field 
 
 

 

 

Name

Value 1Value 2DescriptionExample
uc:site-attribute-booleanName of the attributeDefault ValueA yes/no attribute that appears as a checkbox in the user interface.## uc:site-attribute-boolean="show-comments|true"
uc:site-attribute-colorName of the attributeDefault ValueAn HTML color that displays as a color picker in the user interface 
uc:site-attribute-definitionlistName of the attribute A definition list allows terms/definitions or name/value pair lists to be configured 

uc:site-attribute-deprecated
Name of the attribute Marks an attribute as deprecated to allow the merchant warning that it will disappear in future releases 
uc:site-attribute-htmlName of the attributeDefault ValueA block of HTML. The editor in the user interface is a syntax highlighting editor. 
uc:site-attribute-integerName of the attributeDefault ValueA number input 
uc:site-attribute-itemsetName of the attributeDefault ValueA set of item ids. The input contains a an item search field to make located the items easier. 
uc:site-attribute-multilineName of the attribute A multi-line text input field. 
uc:site-attribute-pagecollectionName of the attribute Provides a rich UI widget allowing merchants to select a group of pages for whatever end is desired 
uc:site-attribute-rgbaName of the attributeDefault Valuergba color picker 
uc:site-attribute-simplelistName of the attribute A simple list allows for a series of information to be configured within an attribute. 
uc:theme-attribute-stringName of the attributeDefault ValueA single line text input field 
 
/**
* item attributes will be configured at the item level using the item editor pages.
*/
public static final String DIRECTIVE_ITEM_ATTRIBUTE_DEPRECATED = "uc:item-attribute-deprecated";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_STRING = "uc:item-attribute-string";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_SIMPLE_LIST = "uc:item-attribute-simplelist";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_DEFINITION_LIST = "uc:item-attribute-definitionlist";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_MULTILINE = "uc:item-attribute-multiline";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_COLOR = "uc:item-attribute-color";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_RGBA = "uc:item-attribute-rgba";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_BOOLEAN = "uc:item-attribute-boolean";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_INTEGER = "uc:item-attribute-integer";
public static final String DIRECTIVE_ITEM_ATTRIBUTE_HTML = "uc:item-attribute-html";

public static final String DIRECTIVE_ITEM_MULTIMEDIA_DEFAULT_USED = "uc:item-multimedia-default-used";
public static final String DIRECTIVE_ITEM_MULTIMEDIA_CODE = "uc:item-multimedia-code";
public static final String DIRECTIVE_ITEM_MULTIMEDIA_CODE_DEPRECATED = "uc:item-multimedia-code-deprecated";

public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_DEPRECATED = "uc:blog-post-attribute-deprecated";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_STRING = "uc:blog-post-attribute-string";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_SIMPLE_LIST = "uc:blog-post-attribute-simplelist";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_DEFINITION_LIST = "uc:blog-post-attribute-definitionlist";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_MULTILINE = "uc:blog-post-attribute-multiline";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_COLOR = "uc:blog-post-attribute-color";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_RGBA = "uc:blog-post-attribute-rgba";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_BOOLEAN = "uc:blog-post-attribute-boolean";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_INTEGER = "uc:blog-post-attribute-integer";
public static final String DIRECTIVE_BLOG_POST_ATTRIBUTE_HTML = "uc:blog-post-attribute-html";