Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
This page explains how to enable content tagging in a content app so that authors can add tags to content items.
The magnolia-enterprise-pro-demo-webapp
and the magnolia-enterprise-pro-demo-bundle
for Magnolia 5.6+ contain an example of how to use the Content Tags module. In this page, we show how the Tours app has been modified to enable tagging for tours, and we also provide general instructions and code samples showing how to enable tagging in other apps (Contacts app example).
Make sure your bundle contains the Content tags modules (magnolia-content-tags-core
and magnolia-content-tags
module-ui
).
You can enable content tags in a new content app or in one that already exists. In the examples below, we modify existing apps using decoration. We assume that you are familiar with Magnolia content apps and Definition decoration.
...
subAppClass
to info.magnolia.contenttags.shortcut.TagShortcutAwareBrowserSubApp
. info.magnolia.contenttags.dialog.OpenTagDialogActionDefinition
and make it available for the content items for which you want to enable tags.addTags
, the systmes automatically system automatically provides a translation for the default language (English). If you are using a different name or if you want to change the default translation ("Add tags"), provide an i18n key. search
set the property implementationClass
to info.magnolia.contenttags.app.contenttool.search.TagSearchPresenter
....
Add a configuration node for the workspace - the workspace used by the content app for the content items to which you add tags - to make sure that:
...
. Thi ensures, tha when you delete a tag from the
...
Tags app, the system checks for occurrences of these tags on registered workspaces, it shows notifications about these occurrences and, if you agree, it removes references of the tags on content items in registered workspaces.
...
To enable this, add a node to /modules/content-tags-core/config/taggableWorkspaces
:
Advanced Tables - Table Plus | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
| required The "root" node for content dependencies registration. | |
| required An arbitrary name to register a one taggable workspace for an app. | |
| required Todo | Use the pattern |
| required The name of the workspace of the content app. |
...
Decoration is used to modify the existing tours
app. The decoration is applied by the module magnolia-travel-demo-content-tags
(see the Tours app example). As an additional example we have decorated the contacts
app (see the Contacts app example).
In addition to decorating the apps, we also adapt the content-tags
configuration to ensure that dependencies are managed across workspaces when you delete data.
...
Code Pro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
...
Code Pro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
...