Problem with custom Title tag [solved]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
vhaakman
Forum Members
Forum Members
Posts: 35
Joined: Fri Oct 05, 2012 7:59 am

Problem with custom Title tag [solved]

Post by vhaakman »

Hi,
I'm working on http://www.babytalkcafe.nl, and wanted to incorporate some SEO tricks as described here: http://docs.cmsmadesimple.org/customizi ... timization

So I copied the customized title part and placed it in the head orf my template, like this:

{content block="custom_title" assign="custom_title" oneline=true label="Custom Title Text"}

{if $custom_title}
<title>{custom_title}</title>
{else}
<title>{title} - {sitename}</title>
{/if}

now two things go wrong here, but I can't find the solution, so maybe one of you guys can help me out here.

first: if I go to edit the page, it shows a wysiwig content block instead of a oneline, although this is set to true. That already indicates something goes wrong, although at the other hand the block seems recognized by the system.

Then, if I display the homepage, I first get a smarty error:
Smarty error: [in tpl_head:23 line 6]: [plugin] unknown tag - 'custom_title'

But, there's no title shown at all, so in the if/then/else above, there is a true, which doesnt seem to make sense looking at the smarty error.

Anyway, if anyone can give me a clue what goes wrong here, that would be very apreciated.

Thanks, Vincent
Last edited by vhaakman on Fri Feb 08, 2013 1:20 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Problem with custom Title tag

Post by Rolf »

Hi Vincent,

There was a typo in the text... Try:

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}
grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
vhaakman
Forum Members
Forum Members
Posts: 35
Joined: Fri Oct 05, 2012 7:59 am

Re: Problem with custom Title tag

Post by vhaakman »

That indeed did the trick, don't know where i lost the $ signs and quotes. But solved, thanks!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Problem with custom Title tag

Post by Rolf »

vhaakman wrote:don't know where i lost the $ signs and quotes.
You didn't, it was a typo at the docs website ;)
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Layout and Design (CSS & HTML)”