I want to set a page's CSS Class (or ID), adding it to the body element if possible.
I have a tree structure like so (just an example):
- about us (CSS Class = "about")
- contact us
- company profile
- products (CSS Class = "products")
- all products
- featured products
- community (CSS Class ="community")
I would like to add a "CSS Class" Metadata string to the Page Type.
I've been through the tutorial on using Page Meta Types and I think it's what I need to implement. Add a "CSS Class" Metatype to the page. However, how do I USE THAT metatype on the page to add it as a CSS Class to an element (preferably the body
<!-- Content -->
<!-- content -->
Ideally, if the value is blank, I want to parse up the tree and grab its parent (or grandparent etc.) but for now I'd just be happy knowing how I can best apply this?