Looking for ExpressionEngine v1 addons?

ee-garage.com

Follow @eegarage on Twitter:

NSM Body Class

Version
1.2.0
EE Version
EE2

Download v1.2.0 It's FREE!

Template styling without messy conditionals.

NSM Body class is an EE 2.0 plugin that generates a class="" attribute value from embed template parameters allowing greater CSS styling of templates.

A quick example

The "header" embed tag inside the primary template:

{!-- Primary template: site/index --}
{embed="_includes/.header"
    entry_id="10"
    url_title="my_url_title"
    template="index"
    template_group="pages"
}

The embedded template:

{!-- Embed template: _includes/.header --}
<body {exp:nsm_body_class}>

Produces the following output:

{!-- HTML Output --}
<body class="eid-10 eut-my_url_title t-index tg-pages">

The plugin parses a wide range of parameters. See the tag reference for more information.

This page was last updated on: 2011-11-29