← API Index · How to use components
ticker component .oo-ticker
A ticker shows (potentially periodically changing) information about items and navigation
levels from the shop database. Unlike most components it is addressed by the class
oo-ticker (preferably on a div), and there can be many tickers on one page.
Upon mouse over, the data selection can be scrolled forward / back if there are more elements than the display size. Use it to:
- show one item statically, together with an image and linked to the shop
- show many items vertically or horizontally
- show items, rubrics or subgroup levels
In the backend, a ticker can conveniently be fed by a special navigation entry. That way the
configuration in the web page stays fixed (e.g. data-oo-ticker-data="Navigation:12") while
its content is controlled from the backend.
Note that access to the shop data is always biased by the calling user. Logged on as a customer whose next delivery date is after the display limits of some items, these items will not be shown.
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-ticker" data-oo-ticker-data="Group:114" data-oo-ticker-speed="2"></div>
In this example, item group 114 is used to fetch items.
component switches
| Switch | Default | Description |
|---|---|---|
oo-ticker-data |
– | Required. What to show, as <type>:<id> (see ticker spec). Unlike the other switches this one is read from the element's data- attribute only, since every ticker needs its own value. |
oo-ticker-speed |
4 |
Seconds between content changes. 0: the content doesn't change. |
oo-ticker-size |
1 |
How often the ticker template is repeated, to show several elements at once. The previous / next controls appear only if there is more data than fits. |
oo-ticker-withcart |
true |
false skips items that are already in the cart. |
oo-ticker-empty |
– | CSS selector of page elements to show if no data is found for the ticker spec; the ticker itself stays invisible in that case. |
oo-item-image-pi-size |
0 |
Image size advice for the item images: a pixel value (square) or w,h[,bg]. 0 means no processing. |
oo-shop-page |
– | Page hosting the shop component; items and groups link to it. |
oo-qpnav |
true |
false appends the navigation level to the URL path of those links instead of using a query parameter. |
Buy button (pick mode)
| Switch | Default | Description |
|---|---|---|
oo-pick-page-anon |
– | Page to go to after "buy" if the user is anonymous (includes located). |
oo-pick-page-auth |
– | Page to go to after "buy" if the user is authenticated. |
oo-pick-subperiod |
none |
Subscription period selector of the buy form: none (default in tickers) removes it, a single integer preselects that period, a /-separated list of integers (0..4) restricts the options with the first one as default. See the shop component. |
Ticker spec
The value of oo-ticker-data is <entity>:<id>; entity names may be abbreviated (i Item,
g Group, sg SubGroup, r Rubric, a Assortment, ag AssortmentGroup, n Navigation,
t Article).
Using child elements — any navigation level can be assigned; all entities below that level are shown:
| Spec | Description |
|---|---|
Group:114 |
If the group has subgroups, the ticker runs across these groups; otherwise across all (available and valid) items of it. |
Item:1234 |
This one item. The ticker never changes, even with a speed value. |
Item:0 |
All items flagged as "special offer". |
Navigation:2 |
Iterates through all entities under this top menu entry. A level that contains only one element is resolved, and the items below that element are shown (as everywhere in the shop). |
Using entity references — a negative id shows just that entity itself, so the ticker never changes:
| Spec | Description |
|---|---|
Navigation:-2 |
Renders the top navigation entry 2 itself. Repetition repeats the same element. |
Auto (or 0) instead of a spec shows the items of a random group with more than one element — primarily useful for testing.
Tickers controlled by navigation entries
By assigning a navigation entry to a ticker, the content is controlled entirely from the backend: items as well as item groups (rubrics, subgroups) can be added to that entry. The latter appear as a group or as the resolved item set, depending on how they are added to the menu. A single item group is always resolved to its items.
debug options
Debug scope ticker (enable with data-oo-debug="true" on the element or debug:ticker:<term>+, see the skill):
| Term | Description |
|---|---|
ticker:all |
Data resolution (raw nodes, spec handling), tick cycle, in-cart checks. Output is prefixed with the ticker instance. |
Design tips
- Repeating on a single element gives an attention gathering flicker effect.
.oo-ticker-controls(previous / next) is shown only once per ticker and only if there is more to show.