Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

how to display something with condition in htl?

Avatar

Level 4

for example i have the below code to be displayed when certain criteria is true

<span class='breadcrumb-separator'>

<font style="vertical-align: inherit;">&gt;</font>

</span>

conditon is certain count is less than 3

if the count is greater than 3, i dont want the above &gt to be displayed

1 Accepted Solution

Avatar

Correct answer by
Level 9

Refer to the examples in the link below:

http://blogs.adobe.com/experiencedelivers/experience-management/htl-intro-part-1/

<div data-sly-test.author="${wcmmode.edit || wcmmode.design}">

  Show this to the author

</div>

<div data-sly-test="${!author}">

  Not in author mode anymore..

</div>

View solution in original post

2 Replies

Avatar

Correct answer by
Level 9

Refer to the examples in the link below:

http://blogs.adobe.com/experiencedelivers/experience-management/htl-intro-part-1/

<div data-sly-test.author="${wcmmode.edit || wcmmode.design}">

  Show this to the author

</div>

<div data-sly-test="${!author}">

  Not in author mode anymore..

</div>

Avatar

Employee

Just to add to the previous reply: official documentation for data-sly-test usage:

HTL Block Statements