Expandir minha barra de realizações na Comunidade.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLUCIONADO

how to restrict authoring for a specific component added using data-sly-resource

Avatar

Level 3

i have added a component inside an other component using data-sly-resource:

 

<sly data-sly-resource="${breadcrumbPath @ resourceType='my-project/components/content/header/topicmenu', selectors='nav'}"></sly>
 
i dont want the above component added using data-sly-resource to be authored by the user.
 
FYI: same component has been added in the main component html twice. one has to be authored (which is working fine as expected), other one should be restricted from authoring. 
Tópicos

Os tópicos ajudam a categorizar o conteúdo da comunidade e aumentam sua capacidade de descobrir conteúdo relevante.

1 Solução aceita

Avatar

Resposta correta de
Level 3

Thank you for your reply @arunpatidar 
actually <sly data-sly-resource .... /> tag was placed inside a data-sly-test tag. if the condition is not satisfied i was calling <sly data-sly-resource .... /> with a selector inside another <sly data-sly-test> tag.

 

i just wanted the second component not to be authored by the user.

 

Got the fix : addedwcmmode='disabled' just inside data-sly-resource

 

 

 

<sly data-sly-resource="${breadcrumbPath @ resourceType='my-project/components/content/header/topicmenu', selectors='nav',wcmmode='disabled'}"></sly>

 

 

 

 

Thanks @arunpatidar 

Ver solução na publicação original

3 Respostas

Avatar

Community Advisor

Hi @ashwinka 
You can't have option to hide/show the breadcrumb component in your component.

 

<sly data-sly-test.isTopicmenu="${properties.isTopicmenuEnabled}" data-sly-resource="${breadcrumbPath @ resourceType='my-project/components/content/header/topicmenu', selectors='nav'}"></sly>

 

Could you please also explain what exactly is the issue? You don't want 2 component, or do you want to add a parsys in your component so author can drag and drop breadcrumb? I am not able to understand the issue/blocker/technical challenges here.

Arun Patidar

AEM LinksLinkedIn

Avatar

Resposta correta de
Level 3

Thank you for your reply @arunpatidar 
actually <sly data-sly-resource .... /> tag was placed inside a data-sly-test tag. if the condition is not satisfied i was calling <sly data-sly-resource .... /> with a selector inside another <sly data-sly-test> tag.

 

i just wanted the second component not to be authored by the user.

 

Got the fix : addedwcmmode='disabled' just inside data-sly-resource

 

 

 

<sly data-sly-resource="${breadcrumbPath @ resourceType='my-project/components/content/header/topicmenu', selectors='nav',wcmmode='disabled'}"></sly>

 

 

 

 

Thanks @arunpatidar 

Avatar

Level 1

thanks