Expand my Community achievements bar.

SOLVED

Newly created tags are not selected/showing after closing and reopening dialog

Avatar

Level 2

Hello community,

I've been trying to wrap my head around the tagfield and all of its nuances and discovered a couple of issues that may be bugs. Either that or I'm not understanding how tags work.

 

Here's my dialog markup for the tagfield:

<themeTags
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/coral/common/form/tagfield"
cq:hideOnEdit="{Boolean}false"
cq:showOnCreate="{Boolean}true"
allowBulkEdit="{Boolean}true"
autocreateTag="{Boolean}true"
fieldDescription="Enter the theme tags"
fieldLabel="Theme Tags"
multiple="{Boolean}true"
rootPath="/content/cq:tags/themes"
name="./themes">
<granite:data
jcr:primaryType="nt:unstructured"
cq-msm-lockable="cq:tags"/>
</themeTags>

The hope is to allow the author to create new tags and have it usable by other authors in other pieces of content.

I can create a new tag by typing in some value. Let's use `Weather` as an example.

 

yesonions_0-1707334061660.png

 

I save the dialog, and see it in CRX:

 

yesonions_1-1707334137422.png

But I do not see it in the tag manager area:

yesonions_2-1707334345436.png

 

Also, when reopening the dialog, i do not see the tag i just created even though it exists in CRX:

yesonions_3-1707334396853.png

 

That's one issue. The other issue is that I can create a theme for everyone to see in tag manager area by entering the tag like this: "Themes : Weather". it gets created on the dialog:

yesonions_4-1707334482705.png

When I save it, it appears in CRX:

yesonions_5-1707334545030.png

I see it in the tag selector:

yesonions_6-1707335268171.png

and in tag manager:

yesonions_7-1707335325668.png

 

but when I reopen the dialog, there are no tags selected. I have to open the tag selector and select the newly created tag in order to save it. It then shows up in CRX like this:

yesonions_8-1707335425498.png

and then finally properly shows up in the dialog when i close and reopen:

yesonions_9-1707335491703.png

 

 

I tried creating a new tag using the lowercase/no whitespace syntax and the system rejected it when I tried to save:

yesonions_10-1707335646274.png

 

I feel like custom tags that don't use the namespace prefix should automatically pick up the path specified in the dialog property and inject the tag properly AND display it as being selected (in the grey box under the input field). Also, it seems to me that if I create a new tag with the proper namespace, it should also be selected  by default without having to re-open the dialog, select the tag that I just created, and then save it again. There seems to be a disconnect there.

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

the tag is created just before submitting the dialog with below call

http://localhost:4502/mnt/overlay/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/...

arunpatidar_0-1707469998465.png



I tried to add namespace in this command but it always create tags inside /content/cq:tags/default location.

I am not sure if there is a way to create tags in the specific namespace but certainly tags can be moved.



Arun Patidar

View solution in original post

5 Replies

Avatar

Community Advisor

did you check this

 

https://experienceleague.adobe.com/docs/experience-manager-65/content/sites/administering/contentman....

 

  • The main restriction for newly created tags is they must be unique within a specific namespace.

Also I see Themes: and themes:  (case sensitive) 

Avatar

Level 2

Themes: was created and saved to CRX when I initially entered Themes : Weather

themes: was created when I re-opened the dialog and selected the tag using the selection dialog (the small square with the checkbox icon that is at the end of the input field)

Avatar

Community Advisor

Hi @yesonions 

1. When you create a tag, it saved inside default namesapce (/content/cq:tags/default), which is outside of rootPath

2. When you create a tag Theme : Default, It takes this as a title and store title : default, try to remove spaces and see if it works , otherwise write a javascript/Or Sling preporessor to change the namespace before storing the default tags inside theme namespace



Arun Patidar

Avatar

Level 2

1. Thank you for this. I found the my newly created tags under /content/cq:tags//default but is there no way to override this path to the one specified by rootPath?

 

2. I treid creating the new tag all lower case without spaces, but AEM prevents this from being saved. I put in a screenshot in my original post:

 

yesonions_10-1707335646274.png

 

Avatar

Correct answer by
Community Advisor

Hi, 

the tag is created just before submitting the dialog with below call

http://localhost:4502/mnt/overlay/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/...

arunpatidar_0-1707469998465.png



I tried to add namespace in this command but it always create tags inside /content/cq:tags/default location.

I am not sure if there is a way to create tags in the specific namespace but certainly tags can be moved.



Arun Patidar