I use custom CSS rules to highlight a menu depending on which page I'm on based on the BODY ID and LI CLASS.
Is there a way of defining a body id and class via the CMS or do I have to create a seperate template for each page to achieve this?
How can I add an ID to the body tag per page?
Re: How can I add an ID to the body tag per page?
in your template
hope this helps
btw, you can use {get_template_vars} to check what variables are usable on a page...
Code: Select all
</__body id="page{$page_id}">
btw, you can use {get_template_vars} to check what variables are usable on a page...
Re: How can I add an ID to the body tag per page?
I used -
in the end.
It seems to work at the moment for me
in the end.
It seems to work at the moment for me

Re: How can I add an ID to the body tag per page?
works also, but isnt automagick 

Re: How can I add an ID to the body tag per page?
What do I do with {get_template_vars}?
Yes I see what the previous hint does. I might have to go with it as I need to insert an ID and a class into the Body tag.
Yes I see what the previous hint does. I might have to go with it as I need to insert an ID and a class into the Body tag.
Re: How can I add an ID to the body tag per page?
with {get_template_vars} you can check what variables are present in that page.
you can use all those variables as you like just like {$sitename} and so on
you can use all those variables as you like just like {$sitename} and so on