Dynamic content objects are content objects that can change their output based on the activity of a plugin on the page. For example, if you have a product item plugin on the page, you can use a dynamic content object to output the name of the product in the header of the page as the title.
In order to handle situations where a dynamic content object is not updated by a plug-in, a default string can be entered which will appear instead.
Please note: Dynamic content objects are only supported in the .net gateway. Older sites still using Jaguar servers will need to be migrated before they are able to use this.
The syntax for adding a dynamic content object to the page is shown below:
In this example, a fictional content object called "CMS_DYNAMIC_KEYWORD" is displayed on the page. If no plugin on the page provides content for an element of this name, the words "Default text" will appear in this location instead.
Standard system objects will resolve before dynamic objects, which allows you to do the following:
Here we've used the system placeholder for the page title as the default text. The result of this will be that if a plugin produces the element "CMS_DYNAMIC_PAGETITLE" then this will be displayed at this location, otherwise the standard CMS page title for that page will appear.
HTML in Default Values
The terminating character combination is a quote followed by a bracket. This means that any HTML can be entered into the default value of a dynamic object, as long as it doesn't contain this symbol combination. For example:
YOU PAY (CMS_DYNAMIC_ITEMYOURPRICEVAT:"")!!!
In the above example, a div has been placed on the page with the class of "pricetest" and it's been given a style that makes it stand out. The content of the div contains a dynamic CMS object with a default value that outputs a style rule that hides the div.
The result of this is that if the "CMS_DYNAMIC_ITEMYOURPRICEVAT" element is generated by a plugin on the page, this will be displayed in a highlighted div. If this is not generated on the page, the entire div will be hidden by the style element in the default string.
Below is a list of plugins that produce dynamic content object data.
Product Item List/Detail
In the list view, returns the category description. In the detail view, returns the product description.
Returns the item reference in the detail view
Returns the item extended description in the detail view
Returns the item specification in the detail view
Returns the item line price excluding vat in the detail view
Returns the item line price including vat in the detail view
Returns "your price" excluding vat in the detail view
Returns "your price" including vat in the detail view
Returns the stock level in the detail view
Returns the quote number of the basket
Returns the net value of the basket
Returns the gross value of the basket
Returns the total number of lines in the basket
Returns the totalnumber of items in the basket
XML Syntax for Third Party Plugin Development
Please note: Not yet fully supported
<Object name="CMS_DYNAMIC_OBJECTNAME" overrides="1"><![CDATA[Data]]></Object>
Name: The name of the dynamic object
Overrides [OPTIONAL]: 1 if this object should override other dynamic objects with the same name if the plugin executes later on the page. If this attribute is omitted or set to 0, the first object with this name will take priority.