Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Set Public "or" Private url in navigation

Avatar

Level 4

Hi All,

When I am putting "or" in between private and public URL then It is not working.

<div data-sly-use.curpage="${'navlink.js' @ navPagePath=page.privatelinkurl || page.publicurl}" data-sly-unwrap> 

Can anybody tell me If I am doing some wrong here

thanks in advance.

5 Replies

Avatar

Level 10

If you try each one on its own - does it work? 

Avatar

Level 4

Yes If I am putting each one on its own , it is working fine.

Avatar

Level 10

I am looking for docs that state an OR operator is supported - did you find that - or are you using it without seeing an example? 

Avatar

Level 4

Yes from document only I tried to put the OR operator . But It is not working. Thats why I posted in the forum for help.

Avatar

Level 10

In this doc:

https://docs.adobe.com/docs/en/htl/docs/block-statements.html

it shows use of the || operator. In you example - did you setup a variable? 

For example - docs state:

The result of a test can be assigned to a variable that can be used later. This is usually used to construct "if else" logic, since there is no explicit else statement:

 <p data-sly-test.abc="${a || b || c}">is true</p>
<p data-sly-test="${!abc}">or not</p>