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.
I save the dialog, and see it in CRX:
But I do not see it in the tag manager area:
Also, when reopening the dialog, i do not see the tag i just created even though it exists in CRX:
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:
When I save it, it appears in CRX:
I see it in the tag selector:
and in tag manager:
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:
and then finally properly shows up in the dialog when i close and reopen:
I tried creating a new tag using the lowercase/no whitespace syntax and the system rejected it when I tried to save:
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.
Solved! Go to Solution.
Hi,
the tag is created just before submitting the dialog with below call
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.
did you check this
The main restriction for newly created tags is they must be unique within a specific namespace.
Also I see Themes: and themes: (case sensitive)
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)
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
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:
Hi,
the tag is created just before submitting the dialog with below call
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.