processwire

Processwire Add css class to page


I there a possibility to add a classname to a page? I can't figure out how to implement such feature or if it already exists.

I'm using Processwire 3.0.42.


Solution

  • Put something like this in your template where the body is:

    <body class="<?php echo $page->template->name; ?>">
    

    That will give your page body tag a class equal to page template name.