diff --git a/network-api/networkapi/templates/fragments/buyersguide/about_nav.html b/network-api/networkapi/templates/fragments/buyersguide/about_nav.html index 5d5275aaff1..577ba37a9c9 100644 --- a/network-api/networkapi/templates/fragments/buyersguide/about_nav.html +++ b/network-api/networkapi/templates/fragments/buyersguide/about_nav.html @@ -1,20 +1,20 @@ {% load bg_nav_tags i18n wagtailroutablepage_tags %} {% with request.get_full_path as current_url %} - {% routablepageurl page 'about-why-view' as about_why_url %} {% routablepageurl page 'how-to-use-view' as how_to_use_url %} + {% routablepageurl page 'about-why-view' as about_why_url %} {% routablepageurl page 'methodology-view' as methodology_url %} {% routablepageurl page 'contact-view' as contact_url %} {% routablepageurl page 'press-view' as press_url %}
-{% endwith %} +{% endwith %} \ No newline at end of file diff --git a/network-api/networkapi/templates/fragments/buyersguide/pni_nav_links.html b/network-api/networkapi/templates/fragments/buyersguide/pni_nav_links.html index c10c7406489..94d296576d3 100644 --- a/network-api/networkapi/templates/fragments/buyersguide/pni_nav_links.html +++ b/network-api/networkapi/templates/fragments/buyersguide/pni_nav_links.html @@ -12,10 +12,11 @@ height="10" > {% if editorial_content_index %} - {{ editorial_content_index }} + {{ editorial_content_index }} {% endif %} {% endwith %} -{% routablepageurl home_page 'about-why-view' as about_why_url %} -{% trans "About" %} +{% routablepageurl home_page 'how-to-use-view' as how_to_use_url %} + +{% trans "About" %} {% trans "Donate" %} {{ post }} diff --git a/network-api/networkapi/wagtailpages/templatetags/bg_nav_tags.py b/network-api/networkapi/wagtailpages/templatetags/bg_nav_tags.py index efe08c0885d..ebd47e3933e 100644 --- a/network-api/networkapi/wagtailpages/templatetags/bg_nav_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/bg_nav_tags.py @@ -30,11 +30,13 @@ def check_active_category(current_category, target_category): return "active" if match else "" -# Determine if a nav link should be active. +# Determine if a nav (sidebar nav or primary nav) link should be active. @register.simple_tag(name="bg_active_nav") -def bg_active_nav(current, target): - return "active" if urlparse(target).path in urlparse(current).path else "" - +def bg_active_nav(current, target, nav="sidebar"): + if nav == "primary_nav": + return "active" if urlparse(target).path in urlparse(current).path else "" + else: + return "active" if urlparse(target).path == urlparse(current).path else "" @register.simple_tag(name="product_in_category") def product_in_category(productpage, categorySlug):