← API Index · How to use components
shoplink component .oo-shoplink
Use this component to enhance <a> tags that point to shop items with an image and details
preview, shown as an overlay on mouse over. It is addressed by the class oo-shoplink
on the link itself; any number of links per page can carry it.
How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.
Kaufen Sie endlich unsere <a href="shop.html?np=i:30010" class="oo-shoplink">Milch</a>!
The href must contain an i:<item id> navigation target (the same notation the shop uses
for links, see the shop component); everything after a following & is ignored.
Links without such a target, or to items that are not available to the current user, are
left untouched — the link still works, there is just no preview.
Unlike other components, the preview template cannot be replaced by an inline template, as
the component manipulates the content of the link: it wraps the link into
span.oo-shoplink-wrapper and appends the overlay (span.oo-overlay) holding the item
details, which reuse the item classes of the shop component.
component switches
| Switch | Default | Description |
|---|---|---|
oo-shop-item-image-thumb |
false |
true uses the small (thumbnail) image in the preview instead of the big one. Shared with the shop component. |
debug options
Debug scope sl (enable with data-oo-debug="true" on the link or debug:sl:all+, see the skill):
| Term | Description |
|---|---|
sl:all |
Link parsing (navigation target found or not), item lookup result. |