← API Index · How to use components
content component .oo-content
This component shows content from the system provided content pool (the shop's mini CMS):
articles maintained by the shop operator in the admin area, or placeholder texts from the
shop's setup. It is addressed by the class oo-content, so a page can hold several of
them. Together with the content navigation component (.oo-contentnavi) it allows building a
set of pages that is easy to maintain by the shop operator.
How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.
<div class="oo-content" data-oo-content="article:18"></div>
<div class="oo-content" data-oo-content="agb" data-oo-content-format="wiki"></div>
<div class="oo-content" data-oo-content="url"></div>
component switches
| Switch | Default | Description |
|---|---|---|
oo-content |
– | Required. What to show, see content spec. Each instance needs its own value, so set it as data- attribute on the element. |
oo-content-format |
– | wiki renders the article using the system's wiki syntax instead of HTML. |
Content spec
| Spec | Description |
|---|---|
article:<id> |
Article from the shop's content pool by id. |
articlesn:<shortname> or simply <shortname> |
Article by its short name. Only short names of published articles are accepted; others render nothing. |
articleph:<name> |
Content of a placeholder from the shop's setup area. Usually HTML, no wiki. |
url |
Takes the short name from the sn query parameter of the page URL (page.html?sn=agb). Also listens to the content navigation component and loads the article selected there, setting the document title to the article name. Use this for a single "article" page driven by .oo-contentnavi. |
auto |
A random article — for testing. |
http… |
A remote address, fetched as is. Use SSL, and mind embedded image paths and script code (which may or may not be executed). A #fragment selects part of the fetched page (jQuery load() semantics). |
Events
| Element | Event | Description |
|---|---|---|
.oo-content |
oo-content-changed |
Fired with the article name after an article was loaded through the content navigation (url spec). |
debug options
Debug scope content (enable with data-oo-debug="true" on the element or debug:content:all+, see the skill):
| Term | Description |
|---|---|
content:all |
Resolved spec and fetched address, content navigation events. |
Design tips
- The HTML editor in the content maintenance area can be configured with preselected CSS classes to choose from. This reduces the risk of design violations by novice content authors.
- For the same reason the wiki format may be preferable: all wiki elements have a well known CSS attached and therefore fall under the design provided.