Add navigation from federal subject to country
The feature
Add a way to navigate back up to country level from a federal subject page.
Why?
Thanks to #351 we now have a way of adding entire pages for subjects on a level lower than country, for example for a state or bundesland. But currently, we have no easy way of navigate back up to the top, which would be good if one enters on this level and cannot use the back button.
Examples and inspiration
No response
Hi! I'm interested to take on the issue, but need to clarify this first. Does this feature already added in the form of button labeled as country? like in this page https://www.govdirectory.org/indonesia/Q3724/
@naufandarmawan Like this: https://www.govdirectory.org/united-kingdom/scotland/ In this case, there should be a navigation/back button to the United Kingdom.
Hi! New to contributing here, interested in giving this a go with a little guidance. Having some issues building the site with snowman.
A more user-friendly alternative to a back button is implementing a breadcrumb navigation component for each page.
For example:
Home / United Kingdom / Scotland
In this structure, Home, United Kingdom, and Scotland act as clickable links that allow users to navigate directly to their respective pages.
Using a back button can create a confusing experience, especially if the user arrived from an unrelated page. In such cases, pressing “Back” might take them somewhere unexpected, whereas breadcrumbs provide clear and predictable navigation.
Breadcrumbs are interesting, but if used, should be used across all pages, not just on federal subjects. So that would be a much larger scope of work.
As a sidenote, the logical trace would be:
Home / Countries / United Kingdom / Scotland
As a gut feeling, implementing breadcrumbs is overkill. I believe we just need something simple on pages for federal subjects.
Hi everyone! I went through the discussion, and I agree that keeping things simple (rather than full breadcrumbs) is ideal for now.
Here’s a suggestion that could work as a minimal, user-friendly solution:
- Add a small “Back to Country” link/button → Right above the federal subject title (or near the top of the page), place a simple link like: ← Back to United Kingdom This is: Clear (shows the parent country name) Lightweight (no extra UI components needed) Consistent (can be reused easily across similar pages)
- Auto-generate the parent link dynamically → Based on the federal subject’s data, extract its country relationship (e.g., “Scotland” → “United Kingdom”).
- Responsive Design Consideration → On mobile, the link could be styled smaller or placed within a dropdown to save space. Happy to contribute a quick prototype. Let me know your thoughts
From a technical standpoint one would need to split ?safeName on / to get the parent safe-name/URL, however, to then get a usable label one would need to look it up by searching all countries for the one with that ?safeName and then pick up the label from ?name.
Here is a suggestion on how it could look like. I am not sure if this is the best place to put the link, but I couldn't think of any better place.
Federal subjects are available for only two countries (the UK and the US), and each has just one federal subject.
I'd say we go with what @Ainali suggested but with a small tweak for clarity.
Make the navigation/back button say:
← Back to country (<country-name>)
Like for Scotland, the button says
← Back to country (United Kingdom)
and for North Carolina,
← Back to country (United States)
Additionally,
-
Ensure the Federal Subjects dropdown on the country-level page shows a pointer cursor on hover for better UX.
-
If possible, have the Federal Subjects dropdown open by default so users don’t have to discover it manually.
I was just reminded of how the styling looks like on organizations, see screenshot:
I think we can reuse exactly this on the federal subjects and just show the level above there instead.
By keeping the same navigation style all over, i don't think we need the help text "← Back to country ()"