-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align local nav and add breadcrumbs for pages (#2598)
* Add local navigation for different scenarios - L3, L2A, L2B, L1A, learning pathways term, tax search page, and course search page * add various header template parts * remove the extra group block that wraps the site breadcrumbs * Add "page" breadcrumbs * Ensure breadcrumbs are displayed only when there are at least 3 levels. * Update breadcrumbs padding top/btm to 18px
- Loading branch information
Showing
25 changed files
with
167 additions
and
47 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Blocks hooks. | ||
* | ||
* @package wporg-learn-2024 | ||
*/ | ||
|
||
use function DevHub\is_parsed_post_type; | ||
|
||
add_filter( 'render_block_data', __NAMESPACE__ . '\modify_header_template_part' ); | ||
|
||
/** | ||
* Update header template based on current query. | ||
* | ||
* @param array $parsed_block The block being rendered. | ||
* | ||
* @return array The updated block. | ||
*/ | ||
function modify_header_template_part( $parsed_block ) { | ||
if ( | ||
'core/template-part' === $parsed_block['blockName'] && | ||
! empty( $parsed_block['attrs']['slug'] ) && | ||
str_starts_with( $parsed_block['attrs']['slug'], 'header' ) && | ||
is_search() | ||
) { | ||
$parsed_block['attrs']['slug'] = 'header-second-archive-title'; | ||
} | ||
return $parsed_block; | ||
} |
18 changes: 18 additions & 0 deletions
18
wp-content/themes/pub/wporg-learn-2024/parts/header-second-archive-title.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /--> | ||
|
||
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group has-light-grey-1-color has-text-color"> | ||
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /--> | ||
<!-- wp:query-title {"type":"archive","showSearchTerm":false,"level":0,"fontSize":"small","fontFamily":"inter"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"menuSlug":"learn","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /--> | ||
|
||
<!-- /wp:wporg/local-navigation-bar --> | ||
|
||
<!-- wp:wporg/language-suggest {"align":"full","style":{"color":{"background":"#ebebeb"}}} --> | ||
<div class="wp-block-wporg-language-suggest alignfull has-background" style="background-color:#ebebeb"></div> | ||
<!-- /wp:wporg/language-suggest --> |
18 changes: 18 additions & 0 deletions
18
wp-content/themes/pub/wporg-learn-2024/parts/header-second-post-title.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /--> | ||
|
||
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group has-light-grey-1-color has-text-color"> | ||
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /--> | ||
<!-- wp:post-title {"level":0,"fontSize":"small","fontFamily":"inter"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"menuSlug":"learn","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /--> | ||
|
||
<!-- /wp:wporg/local-navigation-bar --> | ||
|
||
<!-- wp:wporg/language-suggest {"align":"full","style":{"color":{"background":"#ebebeb"}}} --> | ||
<div class="wp-block-wporg-language-suggest alignfull has-background" style="background-color:#ebebeb"></div> | ||
<!-- /wp:wporg/language-suggest --> |
17 changes: 17 additions & 0 deletions
17
wp-content/themes/pub/wporg-learn-2024/parts/header-second.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /--> | ||
|
||
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group has-light-grey-1-color has-text-color"> | ||
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"menuSlug":"learn","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /--> | ||
|
||
<!-- /wp:wporg/local-navigation-bar --> | ||
|
||
<!-- wp:wporg/language-suggest {"align":"full","style":{"color":{"background":"#ebebeb"}}} --> | ||
<div class="wp-block-wporg-language-suggest alignfull has-background" style="background-color:#ebebeb"></div> | ||
<!-- /wp:wporg/language-suggest --> |
20 changes: 20 additions & 0 deletions
20
wp-content/themes/pub/wporg-learn-2024/parts/header-third-archive-title.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /--> | ||
|
||
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group has-light-grey-1-color has-text-color"> | ||
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /--> | ||
<!-- wp:query-title {"type":"archive","level":0,"fontSize":"small","fontFamily":"inter","className":"wporg-local-navigation-bar__fade-in-scroll"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"menuSlug":"learn","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /--> | ||
|
||
<!-- /wp:wporg/local-navigation-bar --> | ||
|
||
<!-- wp:wporg/language-suggest {"align":"full","style":{"color":{"background":"#ebebeb"}}} --> | ||
<div class="wp-block-wporg-language-suggest alignfull has-background" style="background-color:#ebebeb"></div> | ||
<!-- /wp:wporg/language-suggest --> | ||
|
||
<!-- wp:wporg/site-breadcrumbs {"fontSize":"small","style":{"spacing":{"padding":{"top":"18px","bottom":"18px","left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}}} /--> |
20 changes: 20 additions & 0 deletions
20
wp-content/themes/pub/wporg-learn-2024/parts/header-third-post-title.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /--> | ||
|
||
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group has-light-grey-1-color has-text-color"> | ||
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /--> | ||
<!-- wp:post-title {"level":0,"fontSize":"small","fontFamily":"inter","className":"wporg-local-navigation-bar__fade-in-scroll"} /--> | ||
</div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"menuSlug":"learn","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /--> | ||
|
||
<!-- /wp:wporg/local-navigation-bar --> | ||
|
||
<!-- wp:wporg/language-suggest {"align":"full","style":{"color":{"background":"#ebebeb"}}} --> | ||
<div class="wp-block-wporg-language-suggest alignfull has-background" style="background-color:#ebebeb"></div> | ||
<!-- /wp:wporg/language-suggest --> | ||
|
||
<!-- wp:wporg/site-breadcrumbs {"fontSize":"small","style":{"spacing":{"padding":{"top":"18px","bottom":"18px","left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}}} /--> |
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
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/archive-course.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/archive-lesson-plan.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/archive-lesson.html
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
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/page-apply-to-facilitate.html
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
8 changes: 1 addition & 7 deletions
8
wp-content/themes/pub/wporg-learn-2024/templates/page-contribute.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/page-course-complete.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/page-learning-pathways.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/page-my-courses.html
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/page-online-workshops.html
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
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
9 changes: 1 addition & 8 deletions
9
wp-content/themes/pub/wporg-learn-2024/templates/single-course.html
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
8 changes: 1 addition & 7 deletions
8
wp-content/themes/pub/wporg-learn-2024/templates/single-wporg_workshop.html
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
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
2 changes: 1 addition & 1 deletion
2
wp-content/themes/pub/wporg-learn-2024/templates/taxonomy-learning-pathway.html
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
Oops, something went wrong.