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

OpenCities markup

avatar of OpenCities Product Team

OpenCities Product Team

Last updated

OpenCities uses its own markup language to include content and plugins in a web page.

ItemData

This markup renders the content of a specific field. See 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. Please see Change site text and buttons for more information.

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

FieldHasValue

You can use this in a scenario where you want to check if the page contains data for at least one field before rendering a section of your page. You can specify any number of fields - just separate them with “|”.

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

This markup is used to include a specific plugin within a template. This can be a Content list, a form, etc.

<!--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 “|”.

Accepted devices are desktop, tablet and mobile. You can use an exclude filter or an include 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>
<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 variable. Please see Device variables for more information.

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