how to display something with condition in htl? | Community
Skip to main content
Level 3
May 7, 2019
Solved

how to display something with condition in htl?

  • May 7, 2019
  • 2 replies
  • 2919 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Hemant_arora

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>

2 replies

Hemant_arora
Hemant_aroraAccepted solution
Level 8
May 7, 2019

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>

Adobe Employee
May 7, 2019

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

HTL Block Statements