OK, so i've had a great deal of help on here on the rebuild of my site, and I'm onto the last part which is to make sure my pages meta, titles etc are working well.
I have switched (pun) a lot of my templates to using Switchee, and its been really great.
So far I have a few templates that have a global head embed, that inserts basically just the <head>
. Then the main structure of my page with Switchee controlling what content is shown within the main content area.
I have normally used SEO lite, and I like it, but I'm starting to think what the best way to use it with multiple content within a single template is?
Do you think it is best to run a conditional on the embed to determine what content is passed through with the embed to SEO Lite. Or to maybe include a different global head embed with each Switchee case?
Just trying to get my head around the best way to do it, without needlessly repeating things!
Any thoughts appreciated, or if anyones utilised the two together, I'd be interested to hear what they think.
UPDATE
OK, thanks for that tip. I've actually tried it just now, and I can see the benefits. However I am a bit unsure as to how to deal with a certain scenario.
Lets say I have my 'news' index page. This consists of an instance of Switchee, that determines if it is the
- default {latest articles) index page (domain.com/news)
- category page. {domain.com/news/category)
Now, my template is something along the lines of
{embed="includes/_head"}
{lv_page title}
<div class="container">
<div class="main-content">
{exp:switchee variable="{segment_2}" parse="inward"}
{case value="" default="yes"}
{exp:channel:entries channel="news" status="open" paginate="bottom"}
{lv_news_article_details}
{/exp:channel:entries}
{/case}
{case value="category"}
{exp:channel:entries channel="news" category="{segment_3_category_id}" status="open" paginate="bottom"}
{lv_news_article_details}
{/exp:channel:entries}
{/case}
</div>
{lv_sidebar_news}
</div>
{lv_footer}
That's a very simplified version. Now my template shares the same global head embed, but I will want the Title to be "Latest News" for the first case, and "Category News" for the second case. What would be the best way of passing that information to the embed, more conditionals?