Page 1 of 1

HTML META-Tags plugin is cutting the text

Posted: Wed Apr 04, 2007 5:05 pm
by aschlemmer
Hi all,

I'm using the HTML META-Tags to use the entry title as meta description.
Unfortunately, the text is cut inside the automatic generated meta tag:

Code: Select all

 <meta name="description" content=""Gehirn unter Drogen" nennt sich die heutige neurologische Entde" />
because it's not using the h2-tag that I defined in the HTML META-Tags plugin settings.

Would it be better to use a kind of custom fields for this purpose?

And: It talks about using it on single-entry pages, in fact it appears on the frontpage, too.

What is the best way to generate entry-specific descriptions and keywords, any idea?

Thanks in advance
Achim

Posted: Thu Apr 05, 2007 3:51 pm
by judebert
I haven't done much with the custom fields, but it would be a good way to go. Create a custom field called "meta", for example. Then use this Smarty, which inserts the custom meta information on only single-entry pages:

Code: Select all

{if $is_single_entry and isset($entry.properties.ep_meta)}
<meta name="description" content="{$entry.properties.ep_meta} "/>
{/if}
That also checks for the existence of a meta property, but I'm not so certain of its syntax. If it fails for you, try this instead, which provides a default value when the meta property is not set:

Code: Select all

{if $is_single_entry}
<meta name="description" content="{$entry.properties.ep_meta|default:'no description provided'} "/>
{/if}

Posted: Thu Apr 05, 2007 4:05 pm
by aschlemmer
Thanks, Judebert,

this was exactly what I intended to do if there's no other way to manage that.

I will try this around the holidays.

Happy Easter!
Achim

Update: It works, thank you! (see also my follow-up questions if you like)

Re: HTML META-Tags plugin is cutting the text

Posted: Thu Apr 05, 2007 10:44 pm
by judebert
aschlemmer wrote: Unfortunately, the text is cut inside the automatic generated meta tag because it's not using the h2-tag that I defined in the HTML META-Tags plugin settings.
This bit is confusing me a little bit. I understand that you're using the meta tag plugin, and that you've defined H2 as the tag for the plugin to pull meta info from. Why does it get cut? Is it a problem with the plugin, or a problem with the HTML?