-
Notifications
You must be signed in to change notification settings - Fork 28
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
Header: Use different templates based on page heirarchy #500
Conversation
On top level handbook pages there's an issue with misaligned sidebar containers now that the breadcrumbs aren't displayed: Kapture.2024-02-14.at.14.42.01.mp4I think we'll need to change the |
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.
👍 working well for me apart from a couple of things inline
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.
Have you encountered this situation? At /apis
.
Screen.Capture.on.2024-02-16.at.02-45-44.mp4
Fixed in 9eaf52e
I've updated this to match the other pages, so it's 20px now. f018c3f
@renintw I have, but I don't think it's related to this PR, I can replicate it on production. |
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 👍
I have, but I don't think it's related to this PR, I can replicate it on production.
Thanks. I've opened a ticket for it.
@@ -158,7 +158,7 @@ | |||
"wporg-sidebar-container": { | |||
"spacing": { | |||
"margin": { | |||
"top": "150px" | |||
"top": "100px" |
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.
Okay, I think I have it now @adamwoodnz — how's it looking to you? |
…ve, and search page titles.
9e99f50
to
eb51035
Compare
Rebased this PR to make sure it still works after the updated layout changes 👍🏻 |
LGTM! |
See WordPress/wporg-mu-plugins#573 — There are updates to how the local navigation should appear across the site in an effort to simplify, make more responsive, and more consistent. The functionality changes are in
wporg-mu-plugins
, this companion PR serves to update the templates.The header templates are included in the page templates, except for the new
header-third
template. Since this is included based on "hierarchy" rather than template-type, there's a filter in place to swap out the requested header templates. For example, the Block Handbook homepage and interior pages both usesingle-handbook.html
templates, so the template calls forheader-alt
, but if the page is an interior page, it's replaced withheader-third
.This PR also introduces a new block,
page-title
, which serves as a combination of query-title and post-title in one, using the post title on single posts and a search or archive title for those views. It also adds the()
to relevant parser type titles. This avoids needing to create multipleheader-alt
/header-third
templates for each type of content.Background
There are now 3 header possibilities depending on page hierarchy, with 2 variations — in this PR, they correspond to:
patterns/front-page-header.php
parts/header.html
parts/header-alt.html
parts/header-third.html
We don't need to worry about Level 1B, because Level 1 only applies to home, so each site/section should only have one of the two.
Level 2 are items one level deep, with "2A" being things in the local nav, and "2B" not in the local nav. Splitting them avoids repeating the page title in the local nav bar.
Level 3+ are below that, and have breadcrumbs so you can jump back up to Level 2 & 1 (home).
Screenshots
Note: I used the WP-CLI command page to show L2A, but there's a bug that's causing it to not be highlighted in the local nav, tracked here: #498.
To test:
For the best look, apply WordPress/wporg-mu-plugins#573 to wporg-mu-plugins.
View the following pages, and make sure they're using the expected template.