Duplicate Tags property in page properties. | Community
Skip to main content
Level 2
November 7, 2023
Solved

Duplicate Tags property in page properties.

  • November 7, 2023
  • 2 replies
  • 1262 views

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.

 



 

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

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" />

2 replies

Siva_Sogalapalli
Community Advisor
Community Advisor
November 7, 2023
Level 2
November 7, 2023

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

Siva_Sogalapalli
Community Advisor
Community Advisor
November 7, 2023

Can you remove sling:resourceSuperType property and try:

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

 

Mahedi_Sabuj
Community Advisor
Mahedi_SabujCommunity AdvisorAccepted solution
Community Advisor
November 7, 2023

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" />
Mahedi Sabuj
Level 2
November 9, 2023

Hey @mahedi_sabuj Thanks for the help. It works !!