I was trying to add a new link to navbar in my account, I added a new item to navbar beside
Account Settings
.
But I am unable to set a link to it using like {{urls.account.cards}}
. How i implemented the new navbar item is like below.
Ref: Cornerstone github repo
- Edited cornerstone/lang/en.json – Added new object to
"account": {
"nav": {
"recently_viewed": "Recently Viewed",
"settings": "Account Settings",
"cards": "Cards",
},
carditems": {
"heading" : "Testing Cards",
"no_items": "The cards you've saved on our site will appear below."
}
}
- Edited cornerstone/templates/components/account/navigation.html – Added new list under Account Settings
<li class="navBar-item {{#if account_page '===' 'carditems'}}is-active{{/if}}">
<a class="navBar-action" href="{{urls.account.carditems}}">{{lang 'account.nav.cards'}}</a>
</li>
- Edited cornerstone/templates/components/common/navigation-menu.html – Added new list under Account Settings
<li class="navPage-subMenu-item">
<a class="navPage-subMenu-action navPages-action" href="{{urls.account.carditems}}" aria-label="{{lang 'account.nav.cards'}}">{{lang 'account.nav.cards'}}</a>
</li>
- Created new file carditems.html at
cornerstone/templates/pages/account/carditems.html
- carditems.html
{{#partial "page"}}
<div class="account">
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}
<h2 class="page-heading">{{lang 'account.carditems.heading' }}</h2>
{{> components/account/navigation account_page='carditems'}}
{{#unless customer.recently_viewed_products.items}}
{{> components/common/alert/alert-info (lang 'account.carditems.no_items')}}
{{/unless}}
</div>
{{/partial}}
{{> layout/base}}
But I cant get the link to work, so I am not able to show the carditems page
Tried to insert new navbar item and attach link to it.
I was able to add new navbar item but cannot attach link and page to it
0