Tags are short keywords such as
sportsapplied to content items. Tags making finding and reusing content easier.
Tags are also an important enabler feature. Here are some ideas:
- Personalization: Use tags to group content by subject and target audience. Create small reusable content items (events, products, teasers, banners...) and tag them into collections. Now you can serve a collection of related content to the visitor.
Periodic campaigns: Tag your content items according to their sales cycle (
on-sale), season (
grilling) or trendiness (
nordic-noir). Display content by tag on your site, for example in a carousel that cycles through identically tagged items. Change the tags as you move from one period to another. This is a quick way to react to changes in inventory. It's easy to change an entire set of promoted content by tagging only.
The Content Tags module provides tagging functionality in Magnolia, including the Tags app for deleting and renaming tags as well as managing tag dependencies across content items, and a
tagfn templating function.
tagfn provides methods to find both content that is tagged and tags applied to content items.
Try out this feature in the Magnolia demo Tours app (log in using the username and password
Tags vs categories
Tags are keywords or terms assigned to a piece of content. Though similar, tags and categories serve different purposes:
- Categories are groups of pre-defined content that identify the primary topics of your site. In general, content only belongs to one category. For example, in the Magnolia Travel Demo, tours are organized into categories such as Europe, Asia and Africa.
- Tags are free-form and can be defined by authors on the fly. Multiple tags can be applied to many content items. For example, in the Travel demo, a tour can be tagged
adventureregardless of whether it takes place in Europe, Asia or Africa.
Once tagging is enabled for a content app, authors can create and apply tags by selecting item(s) and using the keyboard shortcut T or click the Add tags action to open the tagging dialog.
When you start typing in the Tags field, Magnolia suggests tags that already exist.
Magnolia provides batch tagging so that you can tag a multiple content items in one step.
Use the the
tag: prefix to search through your content on the basis of tags in any content app browser or chooser dialog search field.
Depending on your user permissions, you may also have access to the Tags app. In the Tags app, you can double click on any given tag to see where it is used.
This usage report in the Tags app is useful when you want to remove a tag from all content items where it is used when a campaign ends for instance.
Using tagged content
The tags you apply to content can be used to aggregate and display content in different ways.
For example, content items can be rendered based on tags by creating a template. The
tour-tag page in the demo has a special component called "Tour list by content tag" that renders tours based on their tags.
food tag has been used to aggregate content: