Expand my Community achievements bar.

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

data-sly-resource not editable without wcmmode='disabled'

Avatar

Level 2

Is there a way we can make the data-sly resource NOT EDITABLE without making the wcmmode='disabled'?

Heres my sample code:


<sly data-sly-resource="${resourceType='sample/component', wcmmode='disabled'}"></sly>

1 Accepted Solution

Avatar

Correct answer by
Level 2
2 Replies

Avatar

Correct answer by
Level 2

Avatar

Level 10

You can prevent the component included via data-sly-resource from being editable in AEM authoring mode without disabling wcmmode. Here are two approaches:

Add the decorationTagName attribute to remove the wrapper div that enables authoring UI:

<sly data-sly-resource="${@ resourceType='sample/component', decorationTagName='none'}"></sly>


Add cq:noDecoration property to your component definition (/apps/sample/component/.content.xml):

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" 
          xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="cq:Component"
          cq:noDecoration="{Boolean}true"/>

 

These methods:
1. Keep WCM mode enabled for other components
2. Only remove editability for this specific inclusion
3. Don't affect server-side rendering