how to restrict authoring for a specific component added using data-sly-resource | Community
Skip to main content
ashwinka
Level 2
November 30, 2023
Solved

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

  • November 30, 2023
  • 1 reply
  • 984 views

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. 
Best answer by ashwinka

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 

1 reply

arunpatidar
Community Advisor
Community Advisor
November 30, 2023

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
ashwinka
ashwinkaAuthorAccepted solution
Level 2
November 30, 2023

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 

Level 2
August 25, 2025

thanks 🙂