tagfn

tagfn helps you find content by tag. You can also find out what tags are applied to a particular content item.

The tagfn templating functions are provided by the Content Tags module. The Java class that implements the methods is info.magnolia.contenttags.templating.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.

Method signature

Set<ContentMap>getContentByTags(String workspace, String rootPath, String…​ tagsArray)

Arguments

Argument Description

workspace

required

The workspace to search in.

rootPath

required

The root path of the node to search in.

tagsArray

required

Any array of tags.

Returns

A Set of ContentMap objects.

Usage

/using-content-tags/templates/components/getContentByTags.ftl

Getting tags by content

Returns the tags of a given content node.

Method signature

Set<String> getTags(``ContentMapcontent)

Arguments

Argument Description

content

required

The content map whose tags you want to find.

Returns

A Set of Strings.

Usage

Related topics
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules