isNotActivePath.md
October 20, 2017 ยท View on GitHub
isNotActivePath Template Helper
Template helper to check if the supplied path doesn't match the currently active route's path.
Returns either a configurable String, which defaults to 'disabled', or false.
<li class="{{isNotActivePath '/home'}}">...</li>
<li class="{{isNotActivePath path='/home'}}">...</li>
<li class="{{isNotActivePath regex='home|dashboard'}}">...</li>
{{#if isNotActivePath '/home'}}
<span>Show only if '/home' isn't the current route's path</span>
{{/if}}
{{#if isNotActivePath regex='^\\/products'}}
<span>Show only if current route's path doesn't begin with '/products'</span>
{{/if}}
<li class="{{isNotActivePath class='is-disabled' path='/home'}}">...</li>
<li class="{{isNotActivePath '/home' class='is-disabled'}}">...</li>
Arguments
The following can be used by as arguments in isNotActivePath, isNotActiveRoute, isActivePath and isActiveRoute helpers.
- Data context, Optional.
StringorObjectwithname,pathorregex name{String} - Only available forisActiveRouteandisNotActiveRoutepath{String} - Only available forisActivePathandisNotActivePathregex{String|RegExp}