I am developing a new theme and I need to access a link from the list of navigation links. For example, I have a “Articles”, “News”, “Notes”, “About” links in my navigation list.
In my index.hbs, I don’t want the entire navigation list. I want to access one of the links in my navigation list. I can make it a hard link in index.hbs
but is there a dynamic way to access or filter links in {{navigation}}
helper?
Reading through the docs, it mentions that I can use {{has}{{/has}}
but it gives me an error.
{{#foreach navigation}}
{{has slug="news"}}
<a href="{{url absolute="true"}}">{{label}}</a>
{{/has}
{{/foreach}}
Also, {{navigation}}
points to partials/navigation.hbs
. So, I modified it but I am still getting an error when I use the {{has}}
block. The docs say that I can use {{has}}
inside {{foreach navigation}}
.