Skip to content

Instantly share code, notes, and snippets.

@curtisblackwell curtisblackwell/head
Created Aug 13, 2011

Embed
What would you like to do?
eecms: <title> using stash and switchee
<title>{exp:stash:get name="title"}</title>
{exp:stash:set name="title"}
{exp:switchee variable="{last_segment}" parse="inward"}
{case value="" default="Yes"}
{site_name} | [INSERT SITE SLOGAN HERE]
{/case}
{case value="404"}
404 Not Found | {site_name}
{/case}
{!-- Second value checks for pagination --}
{case value="{segment_1}|#^P(\d+)$#"}
{channel} | {site_name}
{/case}
{case value="{segment_2}"}
{title} | {channel} | {site_name}
{/case}
{/exp:switchee}
{/exp:stash:set}
{exp:stash:set name="title"}
{switchee variable="{last_segment}" parse="inward"}
{case value="" default="Yes"}
{site_name} | [INSERT SITE SLOGAN HERE]
{/case}
{case value="404"}
404 Not Found | {site_name}
{/case}
{!-- Second value checks for pagination --}
{case value="{segment_1}|#^P(\d+)$#"}
{channel} | {site_name}
{/case}
{case value="{segment_2}"}
{title} | {channel} | {site_name}
{/case}
{/switchee}
{/exp:stash:set}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.