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>
Publish mode doesn't show any button.
Author Mode
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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
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>
@kiran_22_12 you can also use- `item.itemIndex`
Views
Likes
Replies
Views
Likes
Replies