-
Notifications
You must be signed in to change notification settings - Fork 20
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 a helper to get active links #4285
Merged
Merged
Conversation
This file contains 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
leenagupte
force-pushed
the
active-links-helper
branch
from
October 15, 2024 10:29
97cb32f
to
564631a
Compare
It will be used to help render the side and main navigation blocks that need to know which link to set to active. This method is a helper as it needs to be called from the view to be able to access `request.path` for the current path so that the link can be set to "active".
leenagupte
force-pushed
the
active-links-helper
branch
from
October 15, 2024 10:33
564631a
to
2845ac6
Compare
This changes it to match the labels in the contents_list component, as well as the forthcoming side_navigation block. Removes links being hard-coded to active as this will be set my the new helper. Also updates the YAML sub-page-1 so that the active link can be demonstrated. Fix up to links hash
leenagupte
force-pushed
the
active-links-helper
branch
from
October 15, 2024 10:38
2845ac6
to
12742fb
Compare
leenagupte
changed the title
Add a Active links helper
Add a helper to get active links
Oct 15, 2024
KludgeKML
approved these changes
Oct 15, 2024
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.
LGTM
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
DRY-up the contents list helper that is being created for side navigation so that it can be used in both the side and main navigation blocks.
The helper also supports nested links.
Why
Both the “side navigation” and “main navigation” blocks need to know which page the user is on to set one of the links to active.
A helper was created for the side navigation block. This code should be DRY-ed up to be used in both.
Trello card
How
The
main_navigation
blocks in the YAML files have been updated to demonstrate dynamic active links.Screenshots?