Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.

Follow

Platform Markup

avatar of OpenCities Product Team

OpenCities Product Team

Last updated

The CMS uses its own markup language to include and display content and plugins on a web page. Markups include:

ItemData

Use this markup to render the content of a specific field. Check out our section on fields for more details on fields and field templates.

<ItemData DataDefinition="[Field name]" Template="[Field template name]" />

Snippet

Renders the value of a text snippet based on the user’s selected language. 

<oc:Snippet name="[Name of the snippet]"/>

FieldHasValue

Use this markup when you want to check if a page contains data for at least one field before rendering a section of the page. You can specify as many fields as necessary, just separate them with an "|" character.

This example code will check if a content name or contact phone number has been entered before rendering the contact block:

<oc:FieldHasValue fields="OC Contact Name|OC Contact Phone">
 <div class="side-box event-snapshot">
 <h2 class="side-box-title">
 Contact
 </h2>
 <div class="side-box-content">
<ItemData DataDefinition="OC Contact Name" Template="OC Contact Details Snapshot" />
 
<ItemData DataDefinition="OC Contact Phone" Template="OC Contact Details Snapshot Value" />
</div>
</div>
</oc:FieldHasValue>

WebUserControl

Use this markup to include a specific plugin within a template, such as a content list or a form.

<!--WebUserControl-->[Name of plugin]<!--/WebUserControl-->

DeviceFilter

Device filters are used to show or hide certain sections of your web page based on the device the user is on. You can specify multiple devices by separating them with “|” character.

Accepted devices are desktop, tablet, and mobile. You can use an exclude filter or an include filter.

Exclude filter:

<DeviceFilter exclude="Tablet|Mobile">
 <div class="special-note">
 You have accessed this page from a mobile device. Please use a laptop or a desktop to complete the action.
 </div>
</DeviceFilter>

Include filter:

<DeviceFilter include="Desktop">
<div class="special-note">
You have accessed this page from a mobile device. Please use a laptop or a desktop to complete the action.
</div>
</DeviceFilter>

DeviceVar

This markup renders the value of a Device variables.

Similar to the device filter above, you can include or exclude the variable value based on the user’s device. You can use the same set of devices here and use “|” to separate them if you want to set multiple devices.

<DeviceVar var="[Your variable name]" include/exclude="[Device1]|[Device2]" />

DataListControl

Used in content lists to render controls in the Body top, Body bottom, Header, and Footer templates. There are two variations of this:

  1. Control that doesn’t have a text snippet to get the text from:

    <DataListControl type="SearchKeywordInput"/>
  2. Control that uses the text from a text snippet:

    <oc:DataListControl type="SearchTriggerNoJS" textsnippet="Sys Button Search" />
Was this article helpful?
0 out of 1 found this helpful