I need to implement a menu divided into blocks from app.data.myobject
Can you help me to understand the TEMPLATE7 syntax.
In the code below, I described the {{#if}} logic since I understand it should work
app.data.myobject = [
{
"stage": "Home",
"group": 1
},
{
"stage": "First Title",
"group": 2
},
{
"stage": "Second Title",
"group": 2
},
{
"stage": "Third Title",
"group": 2
},
{
"stage": "About",
"group": 3
}
]
<div class="menu-tab-menu">
<div class="list links-list">
<ul>
{{#each $root.myobject}}
<li><a href="#tab-{{@index}}" class="menu-tab-link tab-link {{#if @first}}tab-link-active{{/if}}">{{this.stage}}</a></li>
{{$if @index>0 && @index<$root.myobject.length-1}}
{{$if $root.myobject[@index].group !== $root.myobject[@index-1].group}}
</ul>
</div>
<!-- -->
<div class="list links-list">
<ul>
{{/if}}
{{/if}}
{{/each}}
</ul>
</div>
</div>
<div class="tabs nested menu-tab-tabs">
{{#each $root.myobject}}
<div id="tab-{{@index}}" class="page-content tab {{#if @first}}tab-active{{/if}}"></div></div></div>
{{/each}}
</div>
</div>