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

Breaking a list using data-sly-list to close and re-open ul tag

breehaf
Level 1
Level 1

I want to use sightly data-sly-test to "split" a list, but when I try to close/re-open the <ul> using a condition, the html doesn't get added in the correct place... This is essentially the code I am trying to render (simplified for demo purposes):

<sly data-sly-list.levelOne="${navigationObject.navigationBean.navList}">

<li class="nav-item">

code that repeats for each Nav Item

</li>

<sly data-sly-test="${condition}">

</ul>

                <ul class="navbar-nav logo-containter-sly">

                     <li>

                         content to be placed in between li items on condition

                     </li>

                </ul>

                <ul class="navbar-nav">

</sly>

</sly>

If I leave like this, the code finished looping through the list before it includes the code in the data-sly-test. If I remove the </ul> it includes the code in the correct place (after the li where the condition is true, but before the next li).

Is there a reason this is occurring? is there a way around it??

0 Replies