mrtool / contao-hierarchical-body-class
An contao extension which provides an inserttag to add an css-class based on the sites parent sites
Installs: 55
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Type:contao-module
Requires
- php: >=5.3
- contao/core: >=3.3,<4.0
This package is not auto-updated.
Last update: 2021-12-11 01:49:49 UTC
README
An contao extension which provides an inserttag to add an css-class based on the sites parent sites
How to use:
You can use following inserttags directly in the backend page css field or in the template
{{hbc::default}}
Iterates back to the root page and returns every found valid css class string
{{hbc::first}}
Iterates back to the root page and returns the first occurrence of an valid css class string
{{hbc::12}}
Returns the css class string from the page with id 12
It is also possible to use the extension directly in php
// Default - like {{hbc::default}} $classes = MrTool\HierarchicalBodyClass\Provider\HierarchicalBodyClass::getAll($pageId) // First - like {{hbc::first}} $classes = MrTool\HierarchicalBodyClass\Provider\HierarchicalBodyClass::getFirst($pageId) // From - like {{hbc::12}} $classes = MrTool\HierarchicalBodyClass\Provider\HierarchicalBodyClass::getFrom($pageId)
Additional note
This module is provided "as is", without warranty of any kind. It is still under development if you find any issues please use the github issue tracker.