AEM - Save a tag in a specific namespace | Community
Skip to main content
virginief244896
August 1, 2018

AEM - Save a tag in a specific namespace

  • August 1, 2018
  • 3 replies
  • 2350 views

Hello,

I want to save a new tag in a specific namespace from a tag picker.

I set a tagpicker, with allowCreate=true, mapped on a namespace (tagsPath property):

- When I open the tagbrowser, I can see the tag of the selected namespace

- But when I write a new tag in the tagpicker, it is created in the "Standard tag" namespace.

Is there a configuration or something to map the creation from the tagpicker directly in a specified namespace?

Thanks for your help.

Virginie

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

jantzen_b
Adobe Employee
Adobe Employee
August 1, 2018

I'll go ahead an move this to our Adobe Experience Manager​ community.

smacdonald2008
Level 10
August 1, 2018

Information about tags and administrating them - including namespaces - is located in this AEM doc topic - Administering Tags

virginief244896
August 3, 2018

Thanks for your information smacdonald2008 but I could not find the information in the doc topic.

It does not explain the tag creation from the tagpicker component, only from the tagging tool.

Ratna_Kumar
Level 10
August 3, 2018

Hi,

You can see the Adobe HELPX article on your use case: Adobe Experience Manager Help | Developing HTML Template Language Components that search for Adobe Experience Manager Co… https://helpx.adobe.com/experience-manager/using/tagmanager-api-htl.html

The above article shows you that how to use Tag Manager API to search for the tags.

Also, the tagspicker resourceType doesn't let you create tags, its just let you pick them as shown in the above article. Please note that, you cannot create tags using tagpicker.

Hope this helps!!

Thanks,

Ratna Kumar.

January 22, 2019

1. The tagspicker(/libs/cq/gui/components/common/tagspicker) is depricated from 6.3, so we need to use the      tagfield(cq/gui/components/coral/common/form/tagfield) instead.

     This is the warning you get while looking into the tagspicker : Since 6.3. Please use                                                   /libs/cq/gui/components/coral/common/form/tagfield RT.

2. By default it creates a tag in standard tags and that too using the API :

     TagManager -> canCreateTagByTitle(String tagTitlePath, Locale locale)

     So we need to override the "cq/gui/components/coral/common/form/tagfield" and make below changes.

3. Edit the render.jsp and add /etc/designs/<namespaceYouNeed> on line : 106.

     This will enable the suggestions to be coming from the targeted namespace only.

     Put the identifier class in the line no : 128 to capture this field specific event in tagfield.js

4. Edit the "/apps/<yourProject>/common/structure/tagfield/clientlibs/tagfield/tagfield.js" and use      registry.register("foundation.validation.validator" -> selector -> (use the above Line 128 identifier from render.jsp) -> validate -> to      capture the event of the user defined tag application.

     We need to write a servlet once we receive the user defined tag. -> In this use tagmanager API to create a tag in specific      namespace. -> createTag(String tagID, String title, String description)

     After creation of tag make necessary changes in render.jsp as per the requirement on line :169 to make sure you repaint the      previously tagged tags when we reopen the properties after application of this new namespaced tag.

AEM - Save a tag in a specific namespace