<div class="a-container"
data-sly-resource="${'subscribe' @ resourceType='xyz/components/content/subscribe'}"></div>
<div class="b-container"
data-sly-resource="${'social' @ resourceType='xyz/components/content/social'}"></div>
i have two components and used as resource in other component.
now the problem is, author want to copy this resources from other place and paste in component.
Since its resource and not parsys, im not able to paste it. how to resolve this?
Views
Replies
Total Likes
hi @SudarshanV1,
you can replace the hardcoded data-sly-resource calls with either a Container/Parsys component (like core/wcm/components/container/v1/container) so authors can freely add/copy/rearrange components.
Use the Core Components Container which creates a proper authoring container where authors can drag, drop, copy, and paste components while maintaining responsive layout capabilities
<!-- Replace your hardcoded resources with containers -->
<div class="a-container">
<div data-sly-resource="${'subscribe-container' @ resourceType='core/wcm/components/container/v1/container'}"
data-sly-unwrap="${!wcmmode.edit}"></div>
</div>
<div class="b-container">
<div data-sly-resource="${'social-container' @ resourceType='core/wcm/components/container/v1/container'}"
data-sly-unwrap="${!wcmmode.edit}"></div>
</div>
Then you can configure allowed components via template policies to restrict which components authors can add to each container.
Views
Replies
Total Likes
How do i restrict to allow only one particular type of resource to add in container in this case
Views
Replies
Total Likes
Hi @SudarshanV1
Use a Parsys
<div class="a-container">
<div data-sly-resource="${'a' @ resourceType='wcm/foundation/components/responsivegrid'}"></div>
</div>
<div class="b-container">
<div data-sly-resource="${'b' @ resourceType='wcm/foundation/components/responsivegrid'}"></div>
</div>
or else try below one
Use Component Reference (cq:include / Experience Fragment / Reference Component)
<div class="a-container"
data-sly-resource="${properties.subscribePath @ resourceType='xyz/components/content/subscribe'}"></div>
Regards,
Karishma.
Views
Replies
Total Likes
How do i restrict to allow only one particular type of resource to add in container/Parsys in this case
Views
Replies
Total Likes
Views
Likes
Replies