Page 1 of 1

HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Tue Mar 17, 2009 9:42 pm
by vincem
Hi,

I would like to use the HTML META-Tags plugin to generate Description and Keyword Meta tags in single entries only.

However, I want a generic set of Description and Keyword tags to appear on the main page of the blog and other listing pages.

Here's my issue: if I place these generic Description and Keyword Meta tags in index.tpl, the HTML META-Tags plugin causes duplicate tags in single entry pages. I've tried using the HTML-Head Nugget plugin to generate my generic Description and Keyword Meta tags and even placing it after the HTML META-Tags plugin in case it would check for its presence, but I still get duplicate tags.

Any suggestions would be appreciated. Maybe I'm missing something obvious...

Cheers,

Vince

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 2:35 pm
by judebert
I don't think the HTML Meta-Tags plugin covers this specifically.

However, it would be easy enough to handle in the index.tpl. Just surround your meta information with the Smarty invocation:

Code: Select all

{if $startpage == 'true'}
...meta info...
{/if}
Then that meta info will only be displayed on the startpage. Since the plugin handles only the entry pages, there will be no duplicates.

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 3:09 pm
by Don Chambers
The plugin HAS default meta keyword and meta description values... The plugin will emit those defaults on all pages that entry-specific values are not specified. You do not need to provide them within index.tpl.

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 3:29 pm
by judebert
Thanks, Don!

Ignore my code above. Don knows more about this plugin's use than I do.

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 4:36 pm
by vincem
Thank you both for your replies.

Actually, Judebert's idea was exactly what I was after. Don is right, the plugin does has a default for Description and Keyword but as far as I understand, it is ONLY triggered on single entry pages IF no specific values have been entered at entry publishing time.

So I went ahead and used the code in index.tpl and it all works like a charm for my needs. I am now able to present Googlebot with my blog's official description when it comes to the home page and later different, more specific descriptions and keywords on each individual pages.

My last question would be this, and I apologize for my relative ignorance in Smarty: if in my snippet of code in index.tpl, I could check for "detailed entry" NOT being true (since that's the only mode in which the plugin will issue description and keyword tags), instead of $startpage BEING true, then I could tailor my descriptions even more (for Archives, Static pages, etc). I'm afraid, however, that I don't know what Serendipity value to check for for "single entry" for s9y... Any hints?

Also, while we're at it, where are all those Serendipity values (such as $startpage) stored, is there a single reference that I haven't found?

Thanks in advance!

Vince

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 4:55 pm
by vincem
Sorry, just found it:

Code: Select all

{if $view != 'entry'}
I'll work on the details, but am still curious to know if there is one global source for all those reference values.

UPDATE: Ok, that's embarrassing: I just realized that I was using an earlier version of the plugin which didn't have the option for a default set of description and keyword. Sorry Don, you were right!

Cheers,
Vince

Re: HTML META-Tags plugin duplicates Description and Keyword tag

Posted: Wed Mar 18, 2009 5:48 pm
by Don Chambers
vincem wrote:Sorry Don, you were right!
:wink: That was an option I wanted myself, so I added it.