diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb
index daa4c5bbb..69a963ae5 100644
--- a/app/controllers/content_items_controller.rb
+++ b/app/controllers/content_items_controller.rb
@@ -84,17 +84,7 @@ def set_expiry
end
def set_up_navigation
- # Setting a variant on a request is a type of Rails Dark Magic that will
- # use a convention to automagically load an alternative partial, view or
- # layout. For example, if I set a variant of :taxonomy_navigation and we render
- # a partial called _breadcrumbs.html.erb then Rails will attempt to load
- # _breadcrumbs.html+taxonomy_navigation.erb instead. If this file doesn't exist,
- # then it falls back to _breadcrumbs.html.erb. See:
- # http://edgeguides.rubyonrails.org/4_1_release_notes.html#action-pack-variants
@navigation = NavigationType.new(@content_item.content_item)
- if @navigation.should_present_taxonomy_navigation?
- request.variant = :taxonomy_navigation
- end
end
def with_locale
diff --git a/app/views/shared/_breadcrumbs.html+taxonomy_navigation.erb b/app/views/shared/_breadcrumbs.html+taxonomy_navigation.erb
deleted file mode 100644
index 187e4a4e7..000000000
--- a/app/views/shared/_breadcrumbs.html+taxonomy_navigation.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<% if @content_item.taxon_breadcrumbs.any? %>
- <%= render 'govuk_component/breadcrumbs',
- breadcrumbs: @content_item.taxon_breadcrumbs,
- collapse_on_mobile: true %>
-<% end %>
diff --git a/app/views/shared/_breadcrumbs.html.erb b/app/views/shared/_breadcrumbs.html.erb
index eb4de2e35..e455f4dff 100644
--- a/app/views/shared/_breadcrumbs.html.erb
+++ b/app/views/shared/_breadcrumbs.html.erb
@@ -1,3 +1,11 @@
-<% if @content_item.breadcrumbs.any? %>
- <%= render 'govuk_component/breadcrumbs', breadcrumbs: @content_item.breadcrumbs %>
+<% if @navigation.should_present_taxonomy_navigation? %>
+ <% if @content_item.taxon_breadcrumbs.any? %>
+ <%= render 'govuk_component/breadcrumbs',
+ breadcrumbs: @content_item.taxon_breadcrumbs,
+ collapse_on_mobile: true %>
+ <% end %>
+<% else %>
+ <% if @content_item.breadcrumbs.any? %>
+ <%= render 'govuk_component/breadcrumbs', breadcrumbs: @content_item.breadcrumbs %>
+ <% end %>
<% end %>
diff --git a/app/views/shared/_related_items.html+taxonomy_navigation.erb b/app/views/shared/_related_items.html+taxonomy_navigation.erb
deleted file mode 100644
index 014934a96..000000000
--- a/app/views/shared/_related_items.html+taxonomy_navigation.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-
- <% if @navigation.should_present_taxonomy_navigation? %>
- <%=
- render(
- partial: 'govuk_component/taxonomy_sidebar',
- locals: content_item.taxonomy_sidebar
- ) %>
- <% else %>
- <%=
- render(
- partial: 'govuk_component/related_items',
- locals: content_item.related_items
- ) %>
- <% end %>
-
diff --git a/app/views/shared/_related_items.html.erb b/app/views/shared/_related_items.html.erb
index 37cdf19df..014934a96 100644
--- a/app/views/shared/_related_items.html.erb
+++ b/app/views/shared/_related_items.html.erb
@@ -1,3 +1,15 @@
- <%= render partial: 'govuk_component/related_items', locals: content_item.related_items %>
+ <% if @navigation.should_present_taxonomy_navigation? %>
+ <%=
+ render(
+ partial: 'govuk_component/taxonomy_sidebar',
+ locals: content_item.taxonomy_sidebar
+ ) %>
+ <% else %>
+ <%=
+ render(
+ partial: 'govuk_component/related_items',
+ locals: content_item.related_items
+ ) %>
+ <% end %>
diff --git a/app/views/shared/_title_and_translations.html+taxonomy_navigation.erb b/app/views/shared/_title_and_translations.html+taxonomy_navigation.erb
deleted file mode 100644
index a3190ef92..000000000
--- a/app/views/shared/_title_and_translations.html+taxonomy_navigation.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= render 'govuk_component/title', @content_item.title_and_context %>
-<%= render 'shared/translations', translations: @content_item.available_translations %>
diff --git a/app/views/shared/_title_and_translations.html.erb b/app/views/shared/_title_and_translations.html.erb
index 55fa7c969..9af0b1f99 100644
--- a/app/views/shared/_title_and_translations.html.erb
+++ b/app/views/shared/_title_and_translations.html.erb
@@ -1,6 +1,11 @@
-
-
- <%= render 'govuk_component/title', @content_item.title_and_context %>
+<% if @navigation.should_present_taxonomy_navigation? %>
+ <%= render 'govuk_component/title', @content_item.title_and_context %>
+ <%= render 'shared/translations', translations: @content_item.available_translations %>
+<% else %>
+
+
+ <%= render 'govuk_component/title', @content_item.title_and_context %>
+
+ <%= render 'shared/translations' %>
- <%= render 'shared/translations' %>
-
+<% end %>
diff --git a/app/views/shared/_translations.html+taxonomy_navigation.erb b/app/views/shared/_translations.html+taxonomy_navigation.erb
deleted file mode 100644
index c6b256a9b..000000000
--- a/app/views/shared/_translations.html+taxonomy_navigation.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<% if @content_item.available_translations.length > 1 %>
- <%= render 'components/translation-nav',
- translations: @content_item.available_translations %>
-<% end %>
diff --git a/app/views/shared/_translations.html.erb b/app/views/shared/_translations.html.erb
index 84612dba9..3ed9e57c0 100644
--- a/app/views/shared/_translations.html.erb
+++ b/app/views/shared/_translations.html.erb
@@ -1,6 +1,11 @@
<% if @content_item.available_translations.length > 1 %>
-
+ <% if @navigation.should_present_taxonomy_navigation? %>
<%= render 'components/translation-nav',
translations: @content_item.available_translations %>
-
+ <% else %>
+
+ <%= render 'components/translation-nav',
+ translations: @content_item.available_translations %>
+
+ <% end %>
<% end %>