OpenBayou Posted December 13, 2016 Share Posted December 13, 2016 Hi, I'm new to ProcessWire so forgive me if this question has been asked. In WordPress, there's an option to show all classes of any div. For example, if this is my body: <body <?php body_class(); ?>> it outputs the following: <body class="page page-id-2 page-parent page-template-default logged-in"> Does ProcessWire have something similar? Thanks! Link to comment Share on other sites More sharing options...
kongondo Posted December 13, 2016 Share Posted December 13, 2016 Short answer no. ProcessWire does not generate or output any markup. Any markup you add is your own. Maybe if you explained your situation we could show you how to go about it. Link to comment Share on other sites More sharing options...
OpenBayou Posted December 14, 2016 Author Share Posted December 14, 2016 Plan B: Is there a way to add a class to a body based on template on the page? I have three templates in theme: home, recommendations and ads. Example: If the main page uses 'home' template: <?php if template=home : ?> <body class="home"> <?php endif;?> Hope this clears it up. Link to comment Share on other sites More sharing options...
grimezy Posted December 14, 2016 Share Posted December 14, 2016 Hey OpenBayuo, You can just use something like the following? <body class="<?= $page->template ?>"> Hope this helps. 3 Link to comment Share on other sites More sharing options...
OpenBayou Posted December 14, 2016 Author Share Posted December 14, 2016 Good to know. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now