Page 1 of 3

Lazy meta tags:)

Posted: Sun Mar 29, 2009 3:50 pm
by Sonya
I am lazy. It's a pain for me to create keywords and description meta tag for each page.

My lazy solution is autometa tag http://dev.cmsmadesimple.org/projects/autometa . It creates meta tags "keywords" and "description" on-the-fly (only 1 query more). Meta tags are only generated if no meta tags found in pagedata field. It will not substitute your custom meta!

Keywords for the page are taken from Search module that has to be enabled. Description includes first characters of the page content.

Plugin accepts optional parameters:
keywords - set to 0 will prevent generation of keywords meta
description - set to 0 will prevent generation of description meta.
key_number - maximum number of keywords
key_length - minimum length of keyword in characters (to prevent short words from adding to keywords)
key_density - how often is the word found in the page? E.g. is set to 4, only words which are 4 and more times are in the content are added to the keywords meta
key_add - allows to add additional keywords not depending on keywords found, e.g. {autometa key_add="cool site"} would generate meta tag

Code: Select all

<meta name="keywords" content="cool site, [keyword1], [keyword2].../>
desc_length - maximum characters in description meta. The description is automatically truncated at the end of word or sentence and therefore can be shorter as the value given.
desc_add - allows to add something before the generated description, e.g {autometa desc_add="My Company."} would generate meta tag:

Code: Select all

<meta name="description" content="My Company. [page content] .../>
How to use?
Download function.autometa.php and upload to your webspace to the folder plugins. Just place {autometa} in template before or after {metadata}. See help for the tag in Extensions->Tags->autometa.

Enjoy and please tell if you have any difficulties with the lazy tags :)

Re: Lazy meta tags:)

Posted: Sun Mar 29, 2009 7:25 pm
by Nullig
Excellent plugin, Sonya. I will be using this one a LOT.

Thanks

Re: Lazy meta tags:)

Posted: Wed Apr 08, 2009 4:58 pm
by jayPjay
Really really nice job  :D

Anyway to prevent that it use the tag placed in content as description?

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 5:39 am
by Sonya
jayPjay wrote: Really really nice job  :D

Anyway to prevent that it use the tag placed in content as description?
Thank you for your feedback, fix is released: http://dev.cmsmadesimple.org/project/files/652

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 7:12 am
by nhaack
That's a wonderful plug-in for lazy people like me :). I'm courious how it will perform. I will definitely play around with it this weekend and let you know if I come across any problems.

Thank you and best regards
Nils

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 7:25 am
by jayPjay
Sonya wrote:
jayPjay wrote: Really really nice job  :D

Anyway to prevent that it use the tag placed in content as description?
Thank you for your feedback, fix is released: http://dev.cmsmadesimple.org/project/files/652
Really really fast aswell  ;D

ps: Das ging aber sauschnell - DH   8)

Edit: German words like "rückführungen" are splited into: , also using _____ or ------ looks like this:



HTH - THX

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 9:54 am
by Sonya
jayPjay wrote: Edit: German words like "rückführungen" are splited into:
This seems to be a bug in search module. Are there "r&uuml", "ckf&uuml" and "hrungen" as single search words in the table cms_module_search_index? Can you please check it? If so, than please submit bug for Search module, since I just read the the keywords from this table.
jayPjay wrote: , also using _____ or ------ looks like this:

This is something about formatting. Normally you should use to display lines or something like
instead of ---------------- or ______________

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 11:49 am
by jayPjay
Had a look in my SQL, collation was set to latin1_swedish_ci  ???
changed it into german and now its OK.

Using I know, the persons who change the content of a page mostly not  :-\

Thx a lot once more.  :D

Re: Lazy meta tags:)

Posted: Thu Apr 09, 2009 12:06 pm
by Sonya
jayPjay wrote: Using I know, the persons who change the content of a page mostly not  :-\
I know, it's not easy, but you can teach them. There is advhr plugin in TinyMCE which can be activated, show them and tell them you would deinstall TinyMCE if they do not use . It works :)

Re: Lazy meta tags:)

Posted: Fri Apr 10, 2009 12:28 pm
by Sonya
Autometa 1.2 is released :) with support for detail view of News articles.

If the news article is displayed in detail view, keywords meta for the news article is now added automatically. For the description meta you have to open detail template of news and add

Code: Select all

{assign var="autodescription" value=$entry->summary}
or

Code: Select all

{assign var="autodescription" value=$entry->content}
at the top of template.

Tip: you would add the second example if you do not use summary field for your news.

Re: Lazy meta tags:)

Posted: Sat Apr 11, 2009 7:45 am
by jayPjay
Hi again  ;)
On my site I dont get the description tag?
Added the {assign var="autodescription" value=$entry->summary} on top in Detail Template, also I tryed to use it with value=$entry->content" even that I do use summary field.

Re: Lazy meta tags:)

Posted: Sat Apr 11, 2009 8:22 am
by Sonya
jayPjay wrote: Hi again  ;)
On my site I dont get the description tag?
Added the {assign var="autodescription" value=$entry->summary} on top in Detail Template, also I tryed to use it with value=$entry->content" even that I do use summary field.
Hard to say what is wrong. I can only guess:
1. You check summary page, but description is added only in detail view, not on news summary page.
2. You have added {assign var="autodescription" ... in the "false" template which is not used for your site.
3. It is a general problem with the plugin, that I am not aware of. In this case I have to get one feedback more, to see that there is not handling error.

Re: Lazy meta tags:)

Posted: Thu Jul 02, 2009 12:07 am
by kio
I placed

{assign var="autodescription" value=$entry->summary}

in my news detailed template view, but the page still displays main template description, so I have 2
descriptions now. How could I avoid such a thing?

kio

Re: Lazy meta tags:)

Posted: Thu Jul 02, 2009 6:48 am
by Sonya
kio wrote: How could I avoid such a thing?
You should create a special content page for your news and then add detailpage="page alias" for the news call in the template.
For example, if you news page has an alias "news":

Code: Select all

{news number="3" detailpage="news"}
The page "news" should not have any description itself.

Re: Lazy meta tags:)

Posted: Thu Oct 29, 2009 3:43 am
by jwaldeck
Hi Sonya!

First of, tks a lot for this amazing plugin! I've already used it with the news module and it went smooth!

But, I'd like to ask you how I should use it with CGBlog Module, any clue?! I tried to add the following to the detail view template but it didn't work: 

Code: Select all

{assign var='autodescription' value=$entry->content}
Could I be doing something wrong or is there anything else to it that I missed? I cannot send you the link because it is localhost for now, but I assure you no stupid mistake like forgetting the {autometa} tag in the template or something similar is being made.

Cheers!
jw