-
Notifications
You must be signed in to change notification settings - Fork 114
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
Secondary Nav: refactor into new design #8011
Conversation
Exciting! One small thing I'm seeing in the above screenshot is that there's a slash before the parent link "Strategy, Budget and Performance." On Beta—on a Coronavirus page for example—we don't include a slash before the first link of the path. I'd say either approach is technically correct. I wasn't thinking we'd include the first slash but then again it does indicate that there's something (Home) beyond the breadcrumb showing, and I guess the chevron that's currently on cf.gov currently fills that same purpose. I glanced at what USWDS does, and they actually include a "Home" link in every breadcrumb. So, I'm honestly a little torn on if we should include it or not. The main thing I'm feeling is that there should be consistency in approach across pages. |
7385422
to
3e51d43
Compare
@chosak @willbarton Do you have guidance on what is happening with the breadcrumbs on pages that have the caret at the beginning? http://localhost:8000/es/coronavirus/maneje-sus-finanzas/ is another page with the leading slash (caret in the old design). |
|
||
{% for crumb in breadcrumbs %} | ||
|
||
{% if loop.index == loop.length %} |
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.
@anselmbradford in response to your question about the leading slash: in Jinja for
syntax the loop.index
variable is 1-based, not 0-based. So if the length of the breadcrumbs is 1, this will render the divider the first time through the loop. See docs here, you can use loop.index0
instead.
I'm a bit unclear from your comments above with @jenn-franklin -- what is the desired behavior? If you don't want to render the slash if there's only one parent breadcrumb, you could remove this clause, but will it be obvious that this is a breadcrumb then?
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.
We didn't include the first slash during usability testing, and participants didn't struggle to understand that it was a breadcrumb, so that's good! But... ugh... I'm waffling. Haha. I guess ultimately I may lean a little more toward including the first slash.
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.
As is, http://localhost:8000/es/herramientas-del-consumidor/prestamos-para-vehiculos/respuestas/conozca-sus-derechos/ would not have a leading slash, while http://localhost:8000/es/coronavirus/maneje-sus-finanzas/ would. I guess we either always want the slash or always not have it?
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.
Yah, I'd say always slash or never slash.
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.
Yah, I'd say always slash or never slash.
Which one though?
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.
If it's helpful, Jinja has a random
filter if we want to show slashes to some visitors but not others. Keep the cf.gov experience dynamic and interesting!
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.
Let's go with slash!
Changes
How to test this PR
http://localhost:8000/data-research/small-business-lending/filing-instructions-guide/2024-guide/
http://localhost:8000/rules-policy/regulations/1002/
http://localhost:8000/paying-for-college/your-financial-path-to-graduation/
http://localhost:8000/enforcement/payments-harmed-consumers/
http://localhost:8000/es/herramientas-del-consumidor/prestamos-para-vehiculos/respuestas/conozca-sus-derechos/
Resize to mobile. These pages should have a new secondary nav appearance (see screenshots).
Screenshots
Before:
After: