Build 'shared_navigation' schema and 'navigation_items' reverse link with expandable members [WHIT-3342]#4085
Draft
ChrisBAshton wants to merge 8 commits into
Draft
Build 'shared_navigation' schema and 'navigation_items' reverse link with expandable members [WHIT-3342]#4085ChrisBAshton wants to merge 8 commits into
ChrisBAshton wants to merge 8 commits into
Conversation
Also configures it to be a non-renderable format.
Publishing a 'shared_navigation' content item, linked to 'navigation_items' content items, creates a bidirectional relationship.
We need the `details` in order to know the shape of the navigation. The actual content will live in the `links` as `links.navigation_items`.
This was referenced Jun 2, 2026
The example shows: - How we express navigation _structure_ (menu_items, nested menu_items for submenus etc) - How we map that to a flat array of content item hashes via links - How we could support external links in future (via 'type')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
shared_navigationcontent typeshared_navigations->navigation_itemsreverse linkshared_navigationcontent type to have itsdetails.menu_itemshash included when it is surfaced in link expansionREVERSE_LINKS_WITH_MEMBER_EXPANSIONfeature for Publishing API in which all members of a link are also expanded. See below.REVERSE_LINKS_WITH_MEMBER_EXPANSION
When running
DownstreamPayload.new(Document.find_by(content_id: press_release_content_id, locale: "en").editions.last, 1, draft: true).expanded_links.Before - only the Press Release content item itself would be expanded in
shared_navigations[n].links:After - ALL of the documents linked to the shared navigation are now expanded in
shared_navigations[n].links:This is essential for developing the new "shared navigation" feature for landing pages in Q2, as these links define the content of the navigation. The
shared_navigationcontent item itself will only have the structure of the navigation in its details hash.(The latter is currently an arbitrary hash, but the idea is it would contain metadata such as whether a given navigation item should be hidden/shown/highlighted, its order, which nav items are nested within it, etc. The Publishing API schema for it has been kept deliberately permissive for now while we iron out those requirements.)
Why
In order to support the new "shared navigation" feature for landing pages, a key deliverable of Q2.
Jira: https://gov-uk.atlassian.net/browse/WHIT-3342
This application is owned by the Content APIs team. Please let us know in #govuk-content-apis when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.