UPDATE: 2010/04/14: Code now on GitHub
Simple plugin… I am open to suggestions. :D
<
blockquote>ABOUT:
Keywordz will take an input string and output comma-delimited (meta) keyword string. Common and duplicate words will be removed from the output string.
PARAMETERS:
STRING: If left empty, the “default” parameter will be used. DEFAULT: Default is an empty string. Put default keywords here if above “string” is empty. SORT: Default vale is “false”. If you want to allow sorting, set the value to “true”. OPTION: Default value is “length” which will sort keywords by length descending (longest word first). “alphabetical” is the other option, which will sort the keywords alphabetically. ORDER: Default value is “descending”. “ascending” is the alternative value. LIMIT: Default value is “0”, which will return all of the keywords. Specify a whole number greater than zero if you want to limit the number of keywords returned.
USAGE:
This:
{exp:keywordz string="Say hello to the most flexible web publishing system you'll ever meet. ExpressionEngine is a flexible, feature-rich content management system that empowers thousands of individuals, organizations, and companies around the world to easily manage their website. If you're tired of the limitations of your current CMS then take ExpressionEngine for a spin..." sort="false" option="length" order="descending" limit="0" default="foo,bar,baz,bing"}Returns this:
flexible,web,publishing,system,meet,expressionengine,feature,rich,content,management,empowers,thousands,individuals,organizations,companies,world,easily,manage,website,tired,limitations,current,cms,spinReal world example (single entry page):
<meta name="keywords" content="{exp:weblog:entries weblog="{embed:weblog}" limit="1" rdf="off" disable="categories|pagination|member_data|trackbacks"}{exp:keywordz string="{title} {deck}" sort="true" default="multimedia,blog,oregon,eugene,design,web,code,as3"}{/exp:weblog:entries}">I have updated this plugin for usage in EE 2.0. See 2.0 attachment in first post.
I added the ability for plugin to work as a tag pair… Can also be used as a format option for custom fields:
{exp:mah_keywordz sort="false" option="length" order="descending" limit="0" default="foo,bar,baz,bing"}Say hello to the most flexible web publishing system you'll ever meet. ExpressionEngine is a flexible, feature-rich content management system that empowers thousands of individuals, organizations, and companies around the world to easily manage their website. If you're tired of the limitations of your current CMS then take ExpressionEngine for a spin...{/exp:mah_keywordz}Let me know if you have any problems/questions/suggestions. 😊
Micky
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.