If you're just looking for how to handle title
and sections
in the <title>
tag, we use variations of this:
{exp:channel:entries channel="not forms" limit="1" show_future_entries="no" disable="categories|member_data|custom_fields|pagination|trackbacks"}
<title>
{if segment_2=="articles" AND title != ''}MySite - {title}
{if:elseif segment_2 =="" AND segment_2 !="articles" AND segment_1 != ''}MySite - {exp:phpstringfun function="ucwords"}{exp:low_replace find="_" replace="SPACE"}{segment_1}{/exp:low_replace}{/exp:phpstringfun}
{if:elseif segment_2 !="" AND segment_1 != ''}MySite - {exp:phpstringfun function="ucwords"}{exp:low_replace find="_" replace="SPACE"}{segment_1}{/exp:low_replace}{/exp:phpstringfun} :: {exp:phpstringfun function="ucwords"}{exp:low_replace find="_" replace="SPACE"}{segment_2}{/exp:low_replace}{/exp:phpstringfun}
{if:else}
MySite - {tagline}
{/if}
</title>
{/exp:channel:entries}
We set-up most sites, so that there is an article
page that triggers the single post view. We may call it something other than article, but that's the primary trigger. The secondary triggers are for section
pages, like News or About.
I've included our strip and format plugin use. You can use whatever you want, but we use PHPStringFun and Low Replace. This code is just in the header file for the site, and handles everything regarding <title>
with little problem. It's our starter. We occasionally add a few lines with other checks.
Also we deliberately use the not
in channel specification, so it processes everything, except a section never used on the front-end. We choose forms
since we store all forms in a single area, then embed them where needed.
<title>
tag. Or do you want to change the title of the article?