HTML Items

Die HTML-Items sind mit open bi ausgelieferte CMS-Elemente. Sie können über spezielle Tags im HTML-Code angesteuert und in allen Seiten, die von open bi ausgespielt werden, genutzt werden.

Diese Dokumentation erläutert den Zweck jedes HTML-Items und die zur Verfügung stehenden Parameter. Sie ist ausschließlich auf Englisch verfügbar.

Zur Philiosophie von open bi gehört aber auch die Möglichkeit, eigene HTML-Items anlegen zu können. Besuchen Sie hierzu die Kategorie "Tutorials" des open bi Blogs.

General Remarks

The open bi CMS uses HTML Items, which can alter and enhance the HTML output and provide access to open bi features. It is also possible to call actions on the items with HTTP POST requests.

HTML Item Attributes

Custom HTML tags are used to reference a HTML Item. They work the same way as regular HTML tags and can be configured via attributes. By default, all HTML Item attributes are prefixed with "data-":

<customelement data-requires-auth="true">some text</customelement>

The following list shows all default attributes, which can be set on all open bi HTML Items.

Attribute
Documentation
Attribute
data-requires-auth
Documentation
If "true" the element and its contents is only rendered if the user is currently logged in. Default: ""
Attribute
data-onlyforgroup
Documentation
If a usergroup id is specified, the element and its contents is only rendered if the user is logged in and is in the specified usergroup. It is also possible to specify multiple usergroup ids which are separated by semicolon ";", which means that the user must be in one of the usergroups. Default: ""
Attribute
data-onlyforip
Documentation
If one or more IPs are specified separated by semicolon ";" the element and its contents is only rendered if the client IP is in the list of the specified IPs. Default: ""

HTML Item POST Actions

POST requests can be used to communicate with the HTML Items on the current page. They also allow for dynamical HTML Item creation. The POST request must contain an "application/x-www-form- urlencoded" or "multipart/form-data" encoded body. The body must contain a "cms_item" field with the value of either the ID of an existing HTML Item on the current page or the tag name of an HTML Item which then will be created dynamically. The HTML Item specific "data-" attributes can also be added as fields to the body which then will be set onto the HTML Item. Often these HTML Items require a specific "action" which can also be added as a field to the body. So one HTML Item can do different things based on the provided "action".

<content>

The <content> HTML item will display the current role content element from the CMS role depending on the URL path and user language.

Attributes

Attribute
Documentation
Attribute
data-tpl-page-not-found
Documentation
A HTML template which is returned if no role content element is found. (Like a custom 404 page.)

<login>

The <login> HTML item will display different templates depending if a user is logged in or not. It also provides actions for user login and logout.

Attributes

Attribute
Documentation
Attribute
data-tpl-login
Documentation
A HTML template which is returned if the user is currently not logged in.
Attribute
data-tpl-auth
Documentation
A HTML template which is returned if the user is currently logged in.
Attribute
data-redirectonlogin
Documentation
A URL to redirect to after the user logged in with the "openbilogin" action.
Attribute
data-redirectonlogout
Documentation
A URL to redirect to after the user is logged out with the "logout" action.

Actions

Action
Documentation
Action
openbilogin
Documentation
Uses the "username" and "password" form fields to try to login the user and redirects to "data-redirectonlogin" if provided.
Action
logout
Documentation
Logout the current user and redirects to "data- redirectonlogout" if provided.

<openbi:translate>

The <openbi:translate> item returns the language text value for a language text.

Attributes

Attribute
Documentation
Attribute
data-languagetext-id
Documentation
The id of the language text which should be returned.
Attribute
data-template
Documentation
An optional HTML template which is used instead of returning the language text. Placeholders:
%ID%: ID of the language text
%VALUE%: the language text value

<openbi:changelanguage>

The <openbi:changelanguage> item only provides a POST request action which changes the language of the current session.

Actions

Action
Documentation
Action
changelanguage
Documentation
Uses the "language" form field to change the language of the current session. Must be a valid value for "CultureInfo.GetCultureInfo()"

<openbi:dbitem>

The <openbi:dbitem> reads the first row of a database table and replaces all values in a template. It supports static filters, filters from URL parameters and can change the page title with the values of the row.

Static filters can be set in the "data-filter" attribute and are merged with filters from URL parameters. By default, if a URL parameter name matches the name of a column of the table it will be used as a filter. E.g. "?COLUMN1=VALUE1" will automatically filter the result where "COLUMN1 = ‘VALUE1’". This behavior can be customized with the "data-url-filter-whitelist" attribute.

Placeholder format (the column name is always uppercase): %data-placeholder-prefix+COLUMN_NAME%

Example of placeholder if prefix is empty: "%COLUMN1%", "%COLUMN2%"

Example of placeholder if prefix is "Test": "%TestCOLUMN1%", "%TestCOLUMN2%"

Attributes

Attribute
Documentation
Attribute
data-table
Documentation
The name of a table in the database.
Attribute
data-id-column
Documentation
The name of the column used for ID filtering.
Attribute
data-id-parameter
Documentation
The name of the URL parameter for ID filtering.
Attribute
data-id-separator
Documentation
The separator used to separate the ID from the rest of the URL for ID filtering.
Attribute
data-title-column
Documentation
The name of the column whose value is used as the page title.
Attribute
data-title-template
Documentation
The text template for the page title which can contain placeholders.
Attribute
data-columns
Documentation
Semicolon separated list of columns which are read from the table. Default: all columns are used.
Attribute
data-filter
Documentation
Semicolon separated list of static filter values, which are used to filter the table. Example: COLUMN1=VALUE1;COLUMN2=VALUE2
Attribute
data-order-by
Documentation
Comma separated list of columns to order the result. Example: COLUMN1 ASC, COLUMN2 DESC
Attribute
data-placeholder-prefix
Documentation
The prefix used for replacing placeholders. Default: ""
Attribute
data-tpl-detail
Documentation
The template used if a row was found.
Attribute
data-tpl-empty
Documentation
The template used if no row was found.
Attribute
data-read-multiple-tableattributes
Documentation
If set to "X" then also the "multiple" (1-N) table attributes will be read and replaced as JSON arrays. Default: "X"
Example: %PlaceholderPrefixColumnName_JSON%

<openbi:dblist>

The <openbi:dblist> reads rows from a database table and replaces all values in a template. It supports static filters, filters from URL parameters and pagination.

Static filters can be set in the "data-filter" attribute and are merged with filters from URL parameters. By default, if a URL parameter name matches the name of a column of the table it will be used as a filter. E.g. "?COLUMN1=VALUE1" will automatically filter the result where "COLUMN1 = ‘VALUE1’". This behavior can be customized with the "data-url-filter-whitelist" attribute.

Example of placeholder if prefix is empty: "%COLUMN%%", "%COLUMN2%

Example of placeholder if prefix is "Test": "%TestCOLUMN1%", "%TestCOLUMN2%"

Attributes

Attribute
Documentation
Attribute
data-table
Documentation
The name of a table in the database.
Attribute
data-id-column
Documentation
The name of a column used for pagination count.
Attribute
data-title-column
Documentation
The name of the column whose value is used as the page title.
Attribute
data-title-template
Documentation
The text template for the page title which can contain placeholders.
Attribute
data-columns
Documentation
Semicolon separated list of columns which are read from the table. Default: all columns are used.
Attribute
data-filter
Documentation
Semicolon separated list of static filter values, which are used to filter the table. Example: COLUMN1=VALUE1;COLUMN2=VALUE2
Attribute
data-group-by
Documentation
Comma separated list of columns names to group by. Example: COLUMN1, COLUMN2
Attribute
data-order-by
Documentation
Comma separated list of columns to order the result. Example: COLUMN1 ASC, COLUMN2 DESC
Attribute
data-placeholder-prefix
Documentation
The prefix used for replacing placeholders. Default: ""
Attribute
data-sort-parameter
Documentation
The name of the URL parameter which is used for sorting.
Example of valid URL parameter values: "COLUMN1" or "COLUMN2 DESC".
If a URL parameter value is present, then "data-order-by" will be ignored.
Attribute
data-search-parameter
Documentation
The name of the URL parameter which is used for searching. The URL parameter value is splitted by a space (" ") and each part is searched with CONTAINS in every column combined with OR logic. Default: ""
Attribute
data-exactsearch-parameter
Documentation
The name of the URL parameter which is used for searching. The URL parameter value is searched with CONTAINS in every column combined with OR logic. Default: ""
Attribute
data-items-per-page
Documentation
Number of rows per page. Can be left empty to return all rows. Default: "10"
Attribute
data-page-parameter
Documentation
The name of the URL parameter which is used for pagination. Default: "page"
Attribute
data-disable-pagination
Documentation
If the value is set to "X" the automatic pagination item is not rendered.
Attribute
data-placeholder-prefix
Documentation
The prefix used for replacing placeholders. Default: ""
Attribute
data-tpl-item
Documentation
The template used for each row.
Attribute
data-tpl-container
Documentation
The template used to wrap all "data-tpl-item" templates. It should contain the text "%ITEMS%".
Attribute
data-tpl-empty
Documentation
The template used if no row was found.
Attribute
data-url-filter-whitelist
Documentation
Semicolon separated list of column names which should not automatically filtered with URL parameters. Leave empty to disable automatic URL parameter filters.
Attribute
data-read-multiple-tableattributes
Documentation
If set to "X" then also the "multiple" (1-N) table attributes will be read and replaced as JSON arrays. Default: "X"
Example:
%PlaceholderPrefixColumnName_JSON%
Attribute
data-childproducts
Documentation
If the value is set to "X" then also the table attributes which reference other entities are replaced. Default: ""
Example:
%PlaceholderPrefixColumnName.ChildColumnName%"

Actions

Action
Documentation
Action
(default AJAX action)
Documentation
Returns the rows of the table as JSON. The default placeholder naming convention applies also here but without "%". Example: [{ "COLUMN1": "VALUE1" }, { "COLUMN1": "VALUE2" }]

<openbi:redirect>

The <openbi:redirect> item redirects the browser to another host, port, path or query based on the current URL, which means by specifying only a different host only the host part of the current URL is changed and redirected to, keeping all the other parts intact. It also supports redirects to the HTTPS protocol and to "www" subdomains. Optionally a status code (other than the default 302) can be provided. When the created redirect URL is the same as the original URL no redirect will be done.

Attributes

Attribute
Documentation
Attribute
data-redirect-host
Documentation
The new host to redirect to. Defaults to the current host.
Attribute
data-redirect-port
Documentation
The new port to redirect to. Defaults to the current port.
Attribute
data-redirect-path
Documentation
The new path to redirect to. Defaults to the current path.
Attribute
data-redirect-query
Documentation
The new query to redirect to. Defaults to the current query.
Attribute
data-redirect-statuscode
Documentation
The redirect status code. Defaults to "302"
Attribute
data-redirect-www
Documentation
Prefixes the host with "www." if the prefix isn’t already there.
Attribute
data-redirect-https
Documentation
Redirects to the HTTPS protocol on port 443 if no data- redirect-port is specified.

<openbi:httpheader>

The <openbi:httpheader> item adds HTTP response headers base on the "data-name" and "data-value".

Example: <openbi:httpheader data-name="My-Custom-Response-Header" data-value="My Custom Value"></openbi:httpheader>

Attributes

Attribute
Documentation
Attribute
data-name
Documentation
The name of the HTTP response header.
Attribute
data-value
Documentation
The value of the HTTP response header.

<footerbar>

The <footerbar> item adds a second navigation to the website. It can be used e.g. to render links to contact, sitemap and imprint at the footer of the page. To create the menu, the subtree of the CMS role element with the second lowest position is used.

Example: <footerbar></footerbar>

Attributes

Attribute
Documentation
Attribute
data-tpl-footer
Documentation
A HTML template which is used to render the item

<sitemap>

The <sitemap> item adds all subpages of the a navigation menu to the website. To create the menu, the subtree of the CMS role with the lowest position is used.

Example: <sitemap></sitemap>

Attributes

Attribute
Documentation
Attribute
data-tpl-sitemap
Documentation
A HTML template which is used to render the item

<openbi:dropbox>

The <openbi:dropbox> item renders a UI to upload, organize and download documents to an open bi Document Role.

Example: <openbi:dropbox data-id-role="bd546b43-bb3a-4e87-a803-24b677cee9d6" data-requires-auth="true"></openbi:dropbox>

Attributes

Attribute
Documentation
Attribute
data-tpl-role
Documentation
The ID of the document role to use
Attribute
data-tpl-folder
Documentation
You can optionally restrict the display to a folder of the role by specifying the ID of the role element.
Attribute
data-tpl-dropbox
Documentation
A HTML template which is used to render the item
Attribute
data-tpl-dropboxitem
Documentation
A HTML template which is used to render a single item in the document list
Attribute
data-tpl-dropboxtree
Documentation
A HTML template which is used to render the document tree