Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
tagfn provides methods to find both content that is tagged and tags applied to content items.These templating functions are provided by the Content Tags module. The java class implementing the methods is TagTemplatingFunctions.
Getting content by tag and adding tags to the tags trait
The method searches content by workspace, root path and a list (array) of tags. Returned content nodes must have at least one of the tags of the given tag array.
getContentByTags(String workspace, String rootPath, String... tagsArray)
The workspace to search in.
The root path of the node to search in.
Any array of tags.
Getting tags by content
Returns the tags of a given content node.
Set<String> getTags(ContentMap content)
The content map whose tags you want to find.
A Set of Strings.