Sly Pass parameter with an include or similar | Community
Skip to main content
July 10, 2025
Solved

Sly Pass parameter with an include or similar

  • July 10, 2025
  • 1 reply
  • 303 views

Hi, i have an include that brings in an HTML file, which I invoke twice within my component, something like <sly data-sly-include="${'HeaderUserInfoList.html'}"/>. The thing is, in one invocation the full code should be shown, but in the other I want to hide several divs. The code is extensive, so I don’t want to duplicate it — I’d like to pass a parameter (true or false) and hide parts with data-sly-test or something similar. Is there any way to do this? I tried using resource, but it was crashing. My component is Header, and inside it I have this HeaderUserInfoList file — all together in the same component. Best regards and thanks.

 

 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 10, 2025