Last active
August 29, 2015 14:07
-
-
Save adamculpepper/709034500b096c9d3895 to your computer and use it in GitHub Desktop.
ExpressionEngine Body Class Clean-up (cleans up all the tabs and break lines so the classes are all on one line)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Stash: http://devot-ee.com/add-ons/stash | |
Strip Line Breaks: http://devot-ee.com/add-ons/strip-line-breaks | |
Low Replace: http://devot-ee.com/add-ons/low-replace | |
--> | |
{exp:stash:set parse_tags="yes" parse_conditionals="yes" parse_depth="5" type="snippet"} | |
{exp:strip_line_breaks} | |
{stash:body_classes} | |
{exp:low_replace find="\t" replace="" regex="yes"} | |
{structure:top:slug} | |
{if segment_1 == ''}home{/if} | |
{if segment_2} {segment_2}{/if} | |
{if segment_3} {segment_3}{/if} | |
{if segment_2 != ''} sub{/if} | |
{if segment_2 == "agent-forms" || segment_2 == "policyholder-forms"} document-forms{/if} | |
{if segment_2 == "our-mission" || segment_2 == "our-team" || segment_2 == "underwriting-marketing-team"} team{/if} | |
{if logged_in} logged-in{/if} | |
{/exp:low_replace} | |
{/stash:body_classes} | |
{/exp:strip_line_breaks} | |
{/exp:stash:set} | |
<body class="{exp:stash:get type='snippet' name='body_classes'}"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment