Skip to content

Commit 7d5b431

Browse files
author
Vanita Barrett
committed
Use base path to exclude current page from tax nav
Extend the logic we added to exclude the current page from the taxonomy navigation, to also apply to multi-page formats like guides.
1 parent 2ced1c1 commit 7d5b431

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/controllers/content_items_controller.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ def load_content_item
6666
def load_taxonomy_navigation
6767
if @content_item.taxons.present?
6868
taxons = @content_item.taxons.select { |taxon| taxon["phase"] == "live" }
69+
current_base_path = @content_item.base_path
6970

7071
taxon_ids = taxons.map { |taxon| taxon["content_id"] }
71-
services = Supergroups::Services.new(content_item_path, taxon_ids)
72-
guidance_and_regulation = Supergroups::GuidanceAndRegulation.new(content_item_path, taxon_ids)
73-
news = Supergroups::NewsAndCommunications.new(content_item_path, taxon_ids)
74-
policy_and_engagement = Supergroups::PolicyAndEngagement.new(content_item_path, taxon_ids)
75-
transparency = Supergroups::Transparency.new(content_item_path, taxon_ids)
72+
services = Supergroups::Services.new(current_base_path, taxon_ids)
73+
guidance_and_regulation = Supergroups::GuidanceAndRegulation.new(current_base_path, taxon_ids)
74+
news = Supergroups::NewsAndCommunications.new(current_base_path, taxon_ids)
75+
policy_and_engagement = Supergroups::PolicyAndEngagement.new(current_base_path, taxon_ids)
76+
transparency = Supergroups::Transparency.new(current_base_path, taxon_ids)
7677

7778
@taxonomy_navigation = {
7879
services: (services.all_services if services.any_services?),

0 commit comments

Comments
 (0)