Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Resources called via data-sly-resource are not visible in publish mode.

Avatar

Level 2

Hi Community,

I have been trying to call the button resource in my sightly, based on Count authored in dialog. The below code works fine in author mode, but in publish mode. I cannot see the buttons that I authored. 

<sly data-sly-test="${contentBlockModel.includeButtons}"  data-sly-list="${contentBlockModel.ButtonComponentsList}">
<sly data-sly-test.resourceNode="${['button', item] @join='-'}">
<sly data-sly-resource="${ @path=resourceNode,
resourceType='kiran-base/components/content/button', decorationTagName='div'}"></sly>
</sly>
</sly>

 

kiran_22_12_0-1670833392991.png      Publish mode doesn't show any button.

Author Mode

Topics

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

3 Replies

Avatar

Employee

hi @kiran_22_12 ,

 

There is no syntax issue, So, by right button should come. I feel issue is

1) your model is not present or bundle not active in publisher 

or

2) Your content is not there.

 

Can you try printing the values directly such as 

${contentBlockModel.includeButtons}

${contentBlockModel.ButtonComponentsList}

 

Hope this helps.

 

Thanks,

Nikita Garg

Avatar

Level 2

Hi nikita,

My model is present & the content is there as well. I have tried these. They work individually.

But I just solved it using the below code:

<sly data-sly-test="${contentBlockModel.includeButtons}"  data-sly-list="${contentBlockModel.ButtonComponentsList}">
<sly data-sly-resource="${'button{0}' @ format=itemList.count , resourceType='kiran/components/content/button', decorationTagName='div'}"></sly>
</sly>