The situation
A YOOtheme Pro site has one page with blocks that are not for everyone: an invitation to sign up that only logged-out visitors should see, a notice for members of one group, an offer that lasts a week, a banner that only makes sense on mobile. The manual alternatives are duplicated modules, page variants or code in the templates.
How it is solved
evoYTAccess adds an Acceso tab (the tab label is in Spanish) to builder nodes: elements, items, sections, rows and columns. You tick "Activar condiciones de acceso", choose whether the node is shown or hidden when the conditions are met, whether all rules must match or any one will do, and fill in only the rules you need:
- User: guest or logged in, groups, access levels, specific users.
- Language.
- Date and time: from, to, days of the week and a time slot, which can cross midnight.
- Device: desktop, tablet or mobile.
- Category of content, with subcategories if wanted, and of DJ-Catalog2 if it is installed.
- Menu: the active item, with its children if wanted.
The decision is made on the server. If the node does not qualify, it does not appear in the HTML: it is not hidden with CSS. Rows, columns or sections left empty collapse as they do with "Disable element", and a hidden node does not even resolve its dynamic content. While you edit in the builder you see everything, unless you turn on evaluation in the preview.
If you enable conditions but configure no rule, the node renders.
What is involved
Limits
- It is not meant to protect confidential content. The plain-text copy of the layout that YOOtheme stores in the article, used by search, RSS and the API, includes every node.
- With Joomla's page cache on, the date, time, device, menu and category rules are cached for guests. User rules are not, because Joomla does not cache pages for logged-in users.
- The category rule looks at the page, not at each item of a list generated from dynamic content.
- An iPad running iPadOS identifies itself as a Mac and counts as desktop.
- The tab's labels are in Spanish, because YOOtheme does not use Joomla's language files in the builder.
Related products