Specifying custom <title> tag format per page type?

(AstonJ) #1

Is it possible to customise the format for title tags on a page type basis? If not, does anyone know of a plugin, or a plugin that could be used as a basis to create this functionality please?

We can currently do it for email titles:

[%{site_name}] %{optional_pm}%{optional_cat}%{topic_title}

It would be great if we could do this for the view Topic and view Category pages too.

(AstonJ) #2

Anyone have any thoughts on this please?

(David Taylor) #3

It is not currently possible to modify the title format.

What’s the purpose of changing the title? If it is for the benefit of users browsing the site, then it should be possible to override the title using a theme component. If you want to change the title that Google sees, then you would need to use a plugin.

(AstonJ) #4

It’s mainly for the purpose of Google and other bots but it makes sense for readers too (I just need to add one word to make what the forum is about more explicit).

Do you know of any links to threads or guides that could help with making such a plugin please David?

(David Taylor) #5

If you just want to add a single word to the end, you could add it to the “Title” site setting. Although that will appear in more places than just the page title.

For crawlers, a plugin would need to override the page_title method

And for regular browsers it would need to override the titleToken method

I don’t think there’s a step-by-step guide for these kind of overrides, so if you can manage with the site setting change that would be a lot easier.