-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add banner to the taxonomy navigation #1041
Conversation
54e2350
to
3d2d674
Compare
.content_item | ||
.dig('links', 'part_of_step_navs') | ||
.yield_self { |part_of_step_navs| part_of_step_navs || [] } | ||
.select { |step_by_step_nav| step_by_step_nav['document_type'] == 'step_by_step_nav' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part_of_step_navs
should only contain step_by_step_nav
documents so we can remove this line if we want.
@@ -97,6 +97,20 @@ def load_taxonomy_navigation | |||
.yield_self { |document_collections| document_collections || [] } | |||
.select { |document_collection| document_collection['document_type'] == 'document_collection' } | |||
.map { |document_collection| document_collection.values_at('base_path', 'title') } | |||
|
|||
@banner_items = @content_item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we extract this to give it some context? It's a bit hard to mentally parse something this long, so might benefit from pulled out and given a name?
<% navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(@content_item.content_item.parsed_content, request.path) %> | ||
|
||
<% if @tagged_taxons.present? || navigation.breadcrumbs.present? %> | ||
<div class='gem-c-contextual-breadcrumbs'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to remember to communicate that we're doing this 📣
3d2d674
to
4546de0
Compare
4546de0
to
3156396
Compare
This adds a breadcrumb and a banner navigation element listing things a content item is part of. If the content item is tagged to a single topic a full breadcrumb to it is shown. If it is tagged to multiple topics then a home breadcrumb is shown and the topics are listed in the banner. Some examples: - One topic and step by step: /vehicle-insurance - Multiple topics and a step by step: /vehicle-registration/new-and-used-vehicles - One topic, no step by step: /pay-dartford-crossing-charge https://trello.com/c/rznwkADc
3156396
to
6500259
Compare
This adds a breadcrumb and a banner navigation element listing things a content item is part of.
If the content item is tagged to a single topic a full breadcrumb to it is shown. If it is tagged to multiple topics then a home breadcrumb is shown and the topics are listed in the banner.
Some examples:
One topic and step by step:
/vehicle-insurance
Multiple topics and a step by step:
/vehicle-registration/new-and-used-vehicles
One topic, no step by step:
/pay-dartford-crossing-charge
https://trello.com/c/rznwkADc
Visual regression results:
https://government-frontend-pr-1041.surge.sh/gallery.html
Component guide for this PR:
https://government-frontend-pr-1041.herokuapp.com/component-guide