Expand my Community achievements bar.

SOLVED

How to add CQ Tags from the UI.Content

Avatar

Level 7

I'm trying to import a cq:tag name space into /content/_cq_tags, from my ui.content folder, but whenever it is installed into AEM, it turns into a folder, why is this?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@AEMWizard, the filter configuration is not everything. You need a proper .content.xml in you project.

Could you please share a screen shot (similar to the one I have shared) that will present full structure including all folders and files from your project level. Also please share what is inside .content.xml file that represents namespace node on your project level that is incorrectly imported.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @AEMWizard,

I was able to reproduce behavior you have described. In general it seems that you do not have proper .content.xml in your package/project that will provide information about tag namespace. So by default folder will be created.

To solve the issue you need to have appropriate .contnet.xml file for each namespace or tag, and it has to be included in your crx package.

Base on what is inside .content.xml AEM is aware what structure should be created during package installation, what node types should be used, and what properties should be set.

Here is working example of structure on project level - I have test namespace under /content/_cq_tags in my ui.content folder

namespace.jpg

Hers is a sample xml code from above screen, that can be included in .content.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:description="Custom namespace desc"
          jcr:primaryType="cq:Tag"
          jcr:title="Custom namespace title"
          sling:resourceType="cq/tagging/components/tag">
</jcr:root>

Please also remember to check your filter setup. In my example I have used following filter for tags.

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/cq:tags" mode="merge"/>
</workspaceFilter> 

 

Avatar

Level 7

thanks for the feedback, but

This does not work, because it imports the package into a folder, into the crx/de. 

 

<filter root="/content/cq:tags/mybrand" mode="merge"/>

This is what I have,  

Avatar

Correct answer by
Community Advisor

@AEMWizard, the filter configuration is not everything. You need a proper .content.xml in you project.

Could you please share a screen shot (similar to the one I have shared) that will present full structure including all folders and files from your project level. Also please share what is inside .content.xml file that represents namespace node on your project level that is incorrectly imported.