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
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.