Expand my Community achievements bar.

SOLVED

Duplicate Tags property in page properties.

Avatar

Level 2

Hi ,

I have extended tags property in my base page component using below code for basic tab so that i can make that field mandatory.

<basic
jcr:primaryType="nt:unstructured"
jcr:title="Basic"
sling:orderBefore="article"
sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage/tabs/basic"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<title jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<title
jcr:primaryType="nt:unstructured"
maxlength="{Long}70"
fieldDescription="Title must not exceed 70 characters."/>

<tags
jcr:primaryType="nt:unstructured"
required="true" />
</items>
</title>

However It is repeating tags property at the time of new page creation I edit existing page at that time it works fine.

Randeep_virk_0-1699348595210.png

 



 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

In the Basic tab, there are two properties: tags, which is displayed in Edit mode, and tagsShowOnCreate, which is shown in Create mode. When you extend the "tags" property in your project, it also becomes available in Create mode, resulting in both Tags being visible during page creation.

What I've discovered is that if you extend the tags property, always show it on the Create Page. Therefore, I would recommend hiding the tagsShowOnCreate property using granite:hidden={Boolean}true and proceed with extending the tags node as you've shown in your post.

<tags jcr:primaryType="nt:unstructured"
  required="true" />
<tagsShowOnCreate jcr:primaryType="nt:unstructured"
  granite:hidden="{Boolean}true" />

View solution in original post

5 Replies

Avatar

Level 2

Thanks for sharing. I have gone through this however it did n't helped much.

Avatar

Community Advisor

Can you remove sling:resourceSuperType property and try:

sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage/tabs/basic" 

 

Avatar

Correct answer by
Community Advisor

In the Basic tab, there are two properties: tags, which is displayed in Edit mode, and tagsShowOnCreate, which is shown in Create mode. When you extend the "tags" property in your project, it also becomes available in Create mode, resulting in both Tags being visible during page creation.

What I've discovered is that if you extend the tags property, always show it on the Create Page. Therefore, I would recommend hiding the tagsShowOnCreate property using granite:hidden={Boolean}true and proceed with extending the tags node as you've shown in your post.

<tags jcr:primaryType="nt:unstructured"
  required="true" />
<tagsShowOnCreate jcr:primaryType="nt:unstructured"
  granite:hidden="{Boolean}true" />