Last updated: 2006-01-08 23:00
Overview
For this example, let’s say we have a section called news, where we want to categorize articles by several different categories or keywords, which we will call—in a fit of insight—tags.
Go to Admin > Advanced preferences and set one of the custom field names to “Tags”. Any unused field will do.
Then edit your news articles, adding the appropriate keywords to the Tags field. These keywords should be separated by commas, with no spaces before or after the commas. An article about the local dog show might have a Tags field like "Local,Competition,Pets,AKC".
Page template
Your news page template should utilize chh_if_keywords and chh_keywords_articles in the main content area:
<txp:chh_if_keywords>
<txp:chh_keywords_articles
section="news"
wraptag="ul"
break="li" />
<txp:else />
<txp:article form="kw_example" />
</txp:chh_if_keywords>
Article form
Then use chh_keywords_list in the kw_example form:
<txp:if_custom_field name="Tags">
<strong>Filed under:</strong>
<txp:chh_keywords_list
section="news"
field="Tags" />
</txp:if_custom_field>
Browse
Browse to the news section and view an article. Clicking one of the “File under” keyword links should take you to a list of all articles with that keyword.