내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

htl pass data between htl

Avatar

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 ? 

 

 

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

6.5
1 채택된 해결책 개

Avatar

정확한 답변 작성자:
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>

 

 

Arun Patidar

AEM LinksLinkedIn

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Community Advisor and Adobe Champion

 

@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...

 

 

 

Avatar

정확한 답변 작성자:
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>

 

 

Arun Patidar

AEM LinksLinkedIn