I have created a Hierarchical navigation but the issue I am having right now is with the IsDocumentOnSelectedPath()
macro. The menu I created has sub menu items but only the first item under the menu seems to test true for being on the selected path, not any others. Here is my code, perhaps one of you can see what I am doing wrong.
Header 0 - This one works great!
<ul class="nav nav-pills flex-column">
Item 0 - This one works great!
<li class="nav-item">
{% If (NodeHasChildren) { "<div class=\"d-flex justify-content-between align-items-center\">" } #%}
<a href="{% GetNavigationUrl() %}" class="nav-link sjcg-nav-link{% if (IsCurrentDocument()) { " active" } #%}" aria-expanded="{% if (IsDocumentOnSelectedPath()) { "true" } else { "false" } #%}" {% If (NodeHasChildren) { "data-toggle=\"collapse\" role=\"button\" aria-controls=\"sjcg" + NodeID + "\" data-target=\"#sjcg" + NodeID + "\"" } #%} >{% Title %}</a>
{% If (NodeHasChildren) { "<i class=\"material-icons d-block text-dark\">keyboard_arrow_right</i></div>" } #%}
{^SubLevelPlaceHolder^}
</li>
Header 1 (It fails here. I can navigation to a page that is in the path but isDocumentOnSelectedPath resolves as "false". Only the first item that gets rendered seems to work but all the other pages don't.
<div class="collapse{% if (IsDocumentOnSelectedPath()) { " show" } else { " test" } #%}" id="sjcg{% NodeParentID %}">
Item 1 - This one works great!
<a class="nav-link sjcg-nav-link py-0 mb-1 pl-3{% if (IsCurrentDocument()) { " active" } #%}" href="{% GetNavigationUrl() %}">{% Title %}</a>
Footer 1 - This one works great!
</div>
Footer 0 - This one works great!
</ul>
One other thing (so 2 questions)... I think I might have problems later with NodeHasChildren because I only want this to be true if it is of a specific page type and if it is a published child. Is that possible?