Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

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

Avatar

Level 2

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. 
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

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 

View solution in original post

2 Replies

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

Avatar

Correct answer by
Level 2

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