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

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.

2 Replies

Avatar

Level 10

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

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>