diff --git a/app/models/content_item_factory.rb b/app/models/content_item_factory.rb index 9b4bde458a..49d7bd852e 100644 --- a/app/models/content_item_factory.rb +++ b/app/models/content_item_factory.rb @@ -1,9 +1,19 @@ class ContentItemFactory def self.build(content_hash) + content_hash["links"]["ordered_related_items"] = ordered_related_items(content_hash["links"]) if content_hash["links"] + content_item_class(content_hash).new(content_hash) end def self.content_item_class(_content_hash) ContentItem end + + def self.ordered_related_items(links) + return [] if links["ordered_related_items_overrides"].present? + + links["ordered_related_items"].presence || links.fetch( + "suggested_ordered_related_items", [] + ) + end end diff --git a/app/views/shared/_footer_navigation.html.erb b/app/views/shared/_footer_navigation.html.erb new file mode 100644 index 0000000000..7e0f97a7e8 --- /dev/null +++ b/app/views/shared/_footer_navigation.html.erb @@ -0,0 +1,11 @@ +<% @contextual_footer = capture do %> + <%= render 'govuk_publishing_components/components/contextual_footer', content_item: @content_item.to_h %> +<% end %> + +<% if @contextual_footer.present? %> +
+
+ <%= @contextual_footer %> +
+
+<% end %> diff --git a/app/views/shared/_sidebar_navigation.html.erb b/app/views/shared/_sidebar_navigation.html.erb new file mode 100644 index 0000000000..c901f8dcc7 --- /dev/null +++ b/app/views/shared/_sidebar_navigation.html.erb @@ -0,0 +1,3 @@ +
+ <%= render 'govuk_publishing_components/components/contextual_sidebar', content_item: @content_item.to_h %> +