Puzzle Hero Image

Low Title - Addon Review

Low Title is a free add-on by @low who also makes the very popular Low Variables and Low Seg2Cat addons. Low Title has been around for some time, but I only learned about it a couple of months ago and it has revolutionized how I code <title> tags in the document head.

Low Title is a free add-on by @low who also makes the very popular Low Variables and Low Seg2Cat addons. Low Title has been around for some time, but I only learned about it a couple of months ago and it has revolutionized how I code <title> tags in the document head.

Previoiusly to using low title I would typically pass a channel:entries tag through an embed. Something like this:

{embed="embeds/_head" title="{exp:channel:entries channel='blog' limit='1' disable='pagination|custom_fields|categories|member_data'}{title}{/exp:channel:entries} "}

This would require that on each template I customize the embeded channel entries tag and is more difficult if you are using switch:ee to have a single template for your index page and individual entires. To learn more about switch:ee see this excellent article on how to use switch:ee

Low Title makes this much easier and the documentation is super easy to understand. Basically you take your template and pop a variation of the following inside your title tag and Low Title takes care of everyting for you. Be sure to check out the documentation for the different parameters available.

{exp:low_title:category url_title="{segment_3}"}

In my last project I created a snippet that I now place in each template that then creates the title tag for me. It looks like this 

<title>{snip-title} {site_name}</title>

inside the snippet I have the following code which uses switch:ee to help identify which type of page it is.

{exp:switchee variable = "{segment_2}" parse="inward"}
	{!--Listing page no extra title--}
	{case value="#^P(\d+)$#|''"}{/case}
	
	{!--Category name added here--}
	{case value="category"}
		{exp:low_title:category url_title="{segment_3}"} |
	{/case}
	
	{!--convert archive 2012/03 to March, 2012 for monthly archives--}
	{case value="archives"}
		{exp:monthlee month="{segment_4}"}, {segment_3} |
	{/case}
	
	{!--single entry title added here--}
	{case default="yes"}
		{exp:low_title:entry url_title="{segment_2}"} |
	{/case}
{/exp:switchee}

Now I have the title tag in one location for all templates and it pulls the correct title without having to use a full on channel:entries tag. Super easy, super clean - if you're not already using Low Title, you should be. It won't cost you anything, and it will make your title tags smile.