{exp:nsm_body_class}
Renders a class string from parsed template embed parameters.
{exp:nsm_body_class
([
string param_map,
string replace_param_map,
string return
])}
Parameters
param_map="variable_name:prefix" [optional]
The parameter_map parameter defines which embed params will be used to build the class string and how they will be prefixed.
The variable map can be extended or overwritten to add as many extra parameter mapping references as needed using the following syntax:
variable1:prefix1|variable2:prefix2
The default parameter map is:
| Parameter | Prefix |
|---|---|
| entry_id | eid |
| url_title | eut |
| year | y |
| month | m |
| day | d |
| channel_id | cid |
| channel_name | cn |
| template_group | tg |
| template | t |
| body_class |
replace_param_map="yes" [optional, default="no"]
The default behavior of the parameter_map parameter is to extend the map. In some cases it may be required to replace the parameter map.
return="class_str" [optional, default="class_val"]
The default behaviour of the tag is to return the class="" attribute with the generated value string. return="class_str" will return just the class attribute value.
The following two examples render the same output:
<body {exp:body_class return='class_val'}> → <body class="…">
<body class="{exp:body_class return='class_str'}"> → <body class="…">