Customizing Navbar Menu
I need to customize a Navbar menu item to pass a custom id as part of a menu item and I'm not sure that I can do this with Kitchen.
Let's say I'm an Author, logged in as User and have an associated list of Books. My User profile includes my Author id and I want one of my Navbar menu items to list all of my Books. The route needs to get my author id from my user profile and pass the author id to a page that uses the books_by_author query.
A menu item with this html is one approach
{{#with user}}
<li id="menu-item-simple" class="{{menuItemClass 'book'}}">
<a href="{{pathFor 'book' authorId=user.profile.authorId}}">
<span class="item-title">
Books {{user.profile.authorId}}
</span>
</a>
</li>
{{/with}}
I don't see a way to wrap the menu item using the #with user. I tried creating an html file and copy_files to add this to the menu but I get the error There are multiple templates named 'PrivateLayoutLeftMenu. Maybe I should be taking a different approach?
Creating a custom component and remove the actual navbar ?
@rgstephens
- subscribe to your query which returns user document with
authorId - in "book" menu item's
route_paramsadd param{ "name": "authorId", "value": this.user.profile.authorId }
this.user.profile.authorId is null when referenced in the route_params.