evoYTTabs: reference
Element types
| Name in the Builder | Type | What it is |
|---|---|---|
| Tabs | evoyttabs | Container. Draws the navigation and the switchable content. evoAddons group. |
| Tab | evoyttabs_item | One tab. It is a sublayout (fragment): it accepts any Builder element. |
A new Tabs comes with two Tab children, "Tab 1" and "Tab 2". Both types appear in evoMCP's element type list (yootheme_list_element_types) and can be assembled with yootheme_create_page or yootheme_add_node; evoMCP recognises sublayouts and lets you place content inside each Tab.
Properties of the evoyttabs element
| Values | Property | Default |
|---|---|---|
tabs, pills | nav_style | tabs |
top, bottom, left, right | nav_position | top |
left, center, right, justify | nav_align | left |
empty (none), uk-animation-fade, uk-animation-scale-up, uk-animation-scale-down, uk-animation-slide-horizontal, uk-animation-slide-vertical | switcher_animation | empty |
empty (off), hash | url_sync | empty |
empty (off), s (640 px), m (960 px) | mobile_menu | empty |
| text | nav_label | empty |
A value that is not in the list falls back to the factory value in the table: nothing that arrives from a form or a tool reaches the markup as it is. nav_align only applies when nav_position is top or bottom.
The evoyttabs_item element has the property title. With an empty title, the tab is called "Tab N" (N is its position, starting at 1), in English in every language.
Generated markup
| Piece | Markup |
|---|---|
| Wrapper | div.el-element |
| Navigation, Tabs style | ul.el-nav.uk-tab with uk-tab="connect: #<id>"; with a position other than top, uk-tab-bottom, uk-tab-left or uk-tab-right is added |
| Navigation, Pills style | ul.el-nav.uk-subnav.uk-subnav-pill with uk-switcher="connect: #<id>"; with the navigation on the left or right, also uk-flex-column |
| Alignment (top and bottom) | uk-flex-center, uk-flex-right or uk-child-width-expand (justify) |
| Animation | animation: <class> is appended to the connect attribute |
| Content | ul.el-content.uk-switcher#<id>; each tab is an li.el-item holding all its content |
| Left or right position | Navigation and content sit in a uk-grid (uk-width-auto@m for the navigation, uk-width-expand@m for the content) |
The <id> has the form js-<unique element identifier>. Each Tabs carries its own, so several can share a page without clashing. All panels are in the HTML; UIkit hides the inactive ones.
Titles are escaped: nothing typed into a tab reaches the navigation or the menu as HTML.
Builder canvas
While you edit, panels are stacked: each div.el-item has the tab title above and its content below. This is only the editor view; the public site uses the markup above.
Tab identifier in the URL
With url_sync set to hash, each navigation link carries a data-tab attribute with its identifier:
- It is taken from the title in lower case. Letters and digits (including accented ones and other alphabets) are kept, and any other run of characters becomes a hyphen.
- It is cut to 60 characters, with no hyphens at either end.
- With no title, or nothing usable in it:
tab-N, where N is the position starting at 1. - If two tabs of the same element give the same identifier, the second gets
-2, the third-3, and so on.
| Title | Identifier |
|---|---|
| Pricing and plans | pricing-and-plans |
| (empty, third tab) | tab-3 |
| Pricing, Pricing | pricing, pricing-2 |
The evoyttabs.js script
It loads from the plugin's media folder with defer, only if some Tabs on the page has url_sync or mobile_menu turned on, and once per page. It has no dependencies, uses no cookies or storage and makes no requests.
Active tab in the URL:
- On page load it opens the tab named by the fragment, case-insensitively. If none matches, the first one stays open.
- When the tab changes, it writes the fragment with
history.replaceState: the address changes without reloading and without adding history entries. - It only writes when the active tab changes. Moving focus with the arrow keys does not change the URL.
- It listens to
hashchange: an internal link or a manual change of the fragment switches tab. - Each Tabs reacts on its own. If two Tabs on the same page have a tab with the same identifier, both switch. Use different titles if you need to link to them separately.
Mobile menu:
- The navigation gets
uk-visible@soruk-visible@mand the menuuk-hidden@soruk-hidden@m: below the chosen width you see the menu; above it, the bar. - The menu is a button showing the active tab plus an icon, which opens a list (
uk-dropdown, on click). Choosing an option opens that tab, updates the button and closes the list. - It works with Tabs and Pills and with all four positions.
Accessibility
- The tab list carries
aria-label: the "Navigation label" field or the plugin's translated text. - UIkit adds
role="tablist",role="tab",aria-selectedandaria-controls. - Keyboard: the arrow keys move focus between tabs; Enter or Space activates the focused tab. This is UIkit's behaviour.
- The mobile menu button carries
aria-haspopup="true"and, asaria-label, the same text as the navigation; the active option in the list carriesaria-current. - Animation is "none" by default.
Plugin parameters
They are stored as parameters of the system plugin. The values none and off correspond to the empty value of the element properties.
| Parameter | Values |
|---|---|
default_style | tabs, pills |
default_position | top, bottom, left, right |
default_align | left, center, right, justify |
default_animation | none, uk-animation-fade, uk-animation-scale-up, uk-animation-scale-down, uk-animation-slide-horizontal, uk-animation-slide-vertical |
default_url_sync | off, hash |
default_mobile_menu | off, s, m |
evoMCP tools
If evoMCP is installed, the plugin announces itself to it with the component evoyttabs. You need management access to Joomla plugins; to change settings, edit permission as well.
| Permission | Tool | What it does |
|---|---|---|
| Read | evoyttabs_get_settings | Returns the defaults of new Tabs. |
Write; needs human approval; supports dry_run | evoyttabs_set_settings | Changes those values. It does not touch Tabs already on pages. |
| Read | evoyttabs_status | Status of the plugin and of the two element types. |
Parameters of evoyttabs_set_settings (all optional; the ones you do not send stay as they are):
| Parameter | Allowed values |
|---|---|
style | tabs, pills |
position | top, bottom, left, right |
align | left, center, right, justify |
animation | none, uk-animation-fade, uk-animation-scale-up, uk-animation-scale-down, uk-animation-slide-horizontal, uk-animation-slide-vertical |
url_sync | off, hash |
mobile_menu | off, s, m |
A value outside the list raises an error that lists the allowed ones. With dry_run, the response shows the current state and the one that would result (would_change, with from and to) and saves nothing. Without dry_run, it returns the values now stored.
evoyttabs_status returns:
| Field | Content |
|---|---|
plugin_enabled | Whether the plugin is enabled. |
yootheme_installed, yootheme_version | Whether YOOtheme is present and which version. |
yootheme_minimum, yootheme_ok | Minimum version (5.0.0) and whether it is met. |
elements_ok, elements | Whether the files of the two element types are complete, with the detail for each (file, name and templates). |
note | A reminder: elements are registered when YOOtheme starts; this check only verifies the files. |