Skip to content

Instantly share code, notes, and snippets.

@curtisblackwell
Created August 13, 2011 03:43
Show Gist options
  • Save curtisblackwell/1143457 to your computer and use it in GitHub Desktop.
Save curtisblackwell/1143457 to your computer and use it in GitHub Desktop.
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