diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index 2488ece75..20209cdac 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -83,6 +83,8 @@ def format_banner_links(links, type) end def content_item_template + return "guide_single" if @content_item.render_guide_as_single_page? + @content_item.schema_name end diff --git a/app/presenters/content_item/parts.rb b/app/presenters/content_item/parts.rb index da0f12f7c..e44bc4c6b 100644 --- a/app/presenters/content_item/parts.rb +++ b/app/presenters/content_item/parts.rb @@ -61,7 +61,9 @@ def previous_and_next_navigation def part_link_elements parts.map do |part| - if part["slug"] != current_part["slug"] + if render_guide_as_single_page? + { href: "##{part['slug']}", text: part["title"] } + elsif part["slug"] != current_part["slug"] { href: part["full_path"], text: part["title"] } else { href: part["full_path"], text: part["title"], active: true } diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index fdd20948e..6b32ba825 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -78,6 +78,11 @@ def cache_control_public? !content_item.cache_control.private? end + def render_guide_as_single_page? + # /voting-in-the-uk + content_id == "9315bc67-33e7-42e9-8dea-e022f56dabfa" + end + private def display_date(timestamp, format = "%-d %B %Y") diff --git a/app/views/content_items/guide_single.html.erb b/app/views/content_items/guide_single.html.erb new file mode 100644 index 000000000..e0030c800 --- /dev/null +++ b/app/views/content_items/guide_single.html.erb @@ -0,0 +1,51 @@ +<% content_for :extra_head_content do %> + <%= machine_readable_metadata( + schema: :article, + canonical_url: @content_item.canonical_url, + body: @content_item.current_part_body + ) %> +<% end %> + + + +<% content_for :simple_header, true %> + +