website icon indicating copy to clipboard operation
website copied to clipboard

Add navigation from federal subject to country

Open Ainali opened this issue 1 year ago • 10 comments

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

Ainali avatar Mar 15 '24 14:03 Ainali

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 avatar Dec 23 '24 14:12 naufandarmawan

@naufandarmawan Like this: https://www.govdirectory.org/united-kingdom/scotland/ In this case, there should be a navigation/back button to the United Kingdom.

RVA2869 avatar Dec 23 '24 15:12 RVA2869

Hi! New to contributing here, interested in giving this a go with a little guidance. Having some issues building the site with snowman.

Jacob-Stenton avatar Apr 01 '25 14:04 Jacob-Stenton

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.

shreyventure avatar Jul 16 '25 00:07 shreyventure

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.

Ainali avatar Jul 16 '25 01:07 Ainali

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:

  1. 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)
  2. Auto-generate the parent link dynamically → Based on the federal subject’s data, extract its country relationship (e.g., “Scotland” → “United Kingdom”).
  3. 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

Darshithaj avatar Jul 23 '25 14:07 Darshithaj

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.

Abbe98 avatar Oct 14 '25 19:10 Abbe98

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. Image

Ainali avatar Oct 14 '25 19:10 Ainali

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.

mahesh-pgit avatar Oct 27 '25 13:10 mahesh-pgit

I was just reminded of how the styling looks like on organizations, see screenshot:

Image

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 ()"

Ainali avatar Oct 27 '25 14:10 Ainali