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

SOLVED

htl pass data between htl

ebin_Aby
Level 3
Level 3

Is there any way we can pass a variable from component to another. 

 

tried

<sly data-sly-resource="${resourceType='my/components/embeddedComponent', myParam='myValue'}></sly>

can I read the myParam in embeddedComponent ? 

 

 

Topics

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

6.5
1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Not sure if you can do that. But you can try to pass variable as selectors

 

<article data-sly-resource="${'path/to/resource' @ selectors='selector'}"></article>
<article data-sly-resource="${'path/to/resource' @ selectors=['s1', 's2']}"></article>

 

 

View solution in original post

2 Replies
BrianKasingli
Community Advisor
Community Advisor

 

@ebin_Aby 

You can try data-sly-template;

 

<template data-sly-template.component="${ @ title, pageLevel}"><h1>${title}: ${pageLevel}</h1></template>
<div data-sly-call="${component @ title=properties.jcr:title, pageLevel='5'}"></div>

// ouput
<h1>Home Page: 5</h1>

 

Adobe's documentation for data-sly-template can be found here: https://docs.adobe.com/content/help/en/experience-manager-htl/using/htl/block-statements.html#templa...

 

 

 

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Not sure if you can do that. But you can try to pass variable as selectors

 

<article data-sly-resource="${'path/to/resource' @ selectors='selector'}"></article>
<article data-sly-resource="${'path/to/resource' @ selectors=['s1', 's2']}"></article>

 

 

View solution in original post