[solved] Title Tag for SEO

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
zimmo
Forum Members
Forum Members
Posts: 27
Joined: Fri Sep 28, 2012 9:00 am

[solved] Title Tag for SEO

Post by zimmo »

I have tried the following that I found on the documentation

Code: Select all

{content block="custom_title" assign="custom_title" oneline=true label="Custom Title Text"}
 
{if $custom_title}
<title>{custom_title} - {sitename}</title>
{else}
<title>{title} - {sitename}</title>
{/if}
As I wish to have a different title tag for each product in my cms. When I add the above to the template, it falls over. Am I doing this wrong??? I have added the above block to the template, but I get an error then?
Last edited by zimmo on Fri Apr 26, 2013 8:28 am, edited 1 time in total.
uniqu3

Re: Title Tag for SEO

Post by uniqu3 »

It falls over, translated probably means that you have recieved a error message, but didn't bother to mention it?

That error message told you something about unrecognized tag.
Which comes from {custom_title} that is trying to trigger a Smarty plugin name {custom_title}, which well doesn't exist.

When you assigned in content block assign="custom_title", you have assigned it to a variable, which means you should also call that as a variable {$custom_title}
zimmo
Forum Members
Forum Members
Posts: 27
Joined: Fri Sep 28, 2012 9:00 am

Re: Title Tag for SEO

Post by zimmo »

Sorry about that. The error is a smarty template error like you say. But the thing is I am unsure how I add this variable or even do this, I am still new to smarty and cmsms.

The documentation is not very clear then. Can you tell me how I get this to work, where do I add the smarty plug in?

Sorry just trying to get this to work. Appreciate the support.
uniqu3

Re: Title Tag for SEO

Post by uniqu3 »

But i answered already ;D replace {custom_title} with {$custom_title}, you have assigned a content block to a variable, then you should use it as variable.
zimmo
Forum Members
Forum Members
Posts: 27
Joined: Fri Sep 28, 2012 9:00 am

Re: Title Tag for SEO

Post by zimmo »

Ahhh sorry, that simple eh.. Thanks very much got that working how I want it. Impressed that it is on the Main Option page as well, so you can do it all in one place. Brilliant. Many thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Title Tag for SEO

Post by Dr.CSS »

Locked

Return to “[locked] Installation, Setup and Upgrade”