Skip to content

Commit 460fcb5

Browse files
authored
Merge pull request #197 from OpenSourceOrg/feature/gh169-add-ai-wide-template__TRUNK
Add in the means to edit the footer and also to use the standard or A…
2 parents 128b39a + 7a8be66 commit 460fcb5

File tree

11 files changed

+441
-168
lines changed

11 files changed

+441
-168
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"key": "group_68381f7bdc12b",
3+
"title": "AI Template Toggle",
4+
"fields": [
5+
{
6+
"key": "field_68381f7c701f6",
7+
"label": "Use AI Header",
8+
"name": "osi_use_ai_header",
9+
"aria-label": "",
10+
"type": "true_false",
11+
"instructions": "",
12+
"required": 0,
13+
"conditional_logic": 0,
14+
"wrapper": {
15+
"width": "",
16+
"class": "",
17+
"id": ""
18+
},
19+
"relevanssi_exclude": 0,
20+
"message": "This will use any menu named 'ai' for the menu when active",
21+
"default_value": 0,
22+
"allow_in_bindings": 0,
23+
"ui": 0,
24+
"ui_on_text": "",
25+
"ui_off_text": ""
26+
},
27+
{
28+
"key": "field_68381fc3701f8",
29+
"label": "Use AI Footer",
30+
"name": "osi_use_ai_footer",
31+
"aria-label": "",
32+
"type": "true_false",
33+
"instructions": "",
34+
"required": 0,
35+
"conditional_logic": 0,
36+
"wrapper": {
37+
"width": "",
38+
"class": "",
39+
"id": ""
40+
},
41+
"relevanssi_exclude": 0,
42+
"message": "When selected this will use the ai footer, you can edit the footer in reusable blocks.",
43+
"default_value": 0,
44+
"allow_in_bindings": 0,
45+
"ui": 0,
46+
"ui_on_text": "",
47+
"ui_off_text": ""
48+
}
49+
],
50+
"location": [
51+
[
52+
{
53+
"param": "post_type",
54+
"operator": "==",
55+
"value": "page"
56+
},
57+
{
58+
"param": "post_template",
59+
"operator": "==",
60+
"value": "templates\/ai-wide.php"
61+
}
62+
]
63+
],
64+
"menu_order": 0,
65+
"position": "normal",
66+
"style": "default",
67+
"label_placement": "top",
68+
"instruction_placement": "label",
69+
"hide_on_screen": "",
70+
"active": true,
71+
"description": "",
72+
"show_in_rest": 0,
73+
"modified": 1748508671
74+
}

themes/osi/assets/css/editor-style.css

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/css/editor-style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/scss/_8_overrides.templates.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,55 @@ footer.ai-footer {
494494
.ai-def-header .wp-block-coblocks-hero__inner {
495495
height: 850px;
496496
}
497+
// Secondary Nav
498+
.ai-secondary-navbar-wrapper {
499+
background-color: #fff;
500+
border-bottom: 1px solid #ddd;
501+
padding: 10px 0;
502+
position: sticky;
503+
top: 90px; // adjust as needed
504+
z-index: 999;
505+
}
506+
.ai-secondary-nav-menu {
507+
display: flex;
508+
justify-content: center;
509+
gap: 40px;
510+
list-style: none;
511+
margin: 0;
512+
padding: 0;
513+
padding-top: 10px;
514+
font-size: 10px;
515+
li {
516+
display: inline-block;
517+
}
518+
}
519+
// Hide mobile label by default (desktop)
520+
.ai-mobile-label {
521+
display: none;
522+
}
523+
// Mobile-specific styles (not using "force override" block)
524+
@media (max-width: 768px) {
525+
.ai-secondary-mobile-wrapper {
526+
margin-top: 10px;
527+
padding-top: 0;
528+
}
529+
.ai-mobile-label {
530+
display: block;
531+
color: #bbb;
532+
font-size: 13px;
533+
text-transform: uppercase;
534+
padding: 8px 20px 4px;
535+
margin: 0;
536+
letter-spacing: 0.5px;
537+
text-align: right;
538+
}
539+
.ai-secondary-mobile-menu {
540+
margin-top: 0;
541+
li {
542+
padding: 10px 20px;
543+
}
544+
}
545+
}
497546
.jetpack-social-navigation {
498547
height: 40px;
499548
margin: 0;

themes/osi/footer-ai.php

Lines changed: 21 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -8,175 +8,33 @@
88
* @package osi
99
*/
1010

11-
// Get the footer icon
12-
$image_url = get_template_directory_uri() . '/assets/img/osi-horizontal-white.svg';
13-
14-
// Compile the block markup for the footer
15-
$footer_block = <<<HTML
16-
<!-- wp:group {"className":"os-awesome-feedbacak ai-pre-footer","style":{"elements":{"link":{"color":{"text":"var:preset|color|brand-color-1"}}}},"backgroundColor":"neutral-dark","textColor":"neutral-white","layout":{"type":"constrained","contentSize":"100%"},"noBottomMargin":true,"padding":"no"} -->
17-
<div class="wp-block-group os-awesome-feedbacak ai-pre-footer has-neutral-white-color has-text-color has-background has-link-color mb-0"><!-- wp:group {"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"},"padding":"no"} -->
18-
<div class="wp-block-group"><!-- wp:columns {"className":"ai-footer-top wide","style":{"layout":{"selfStretch":"fill","flexSize":null},"spacing":{"margin":{"top":"32px","bottom":"32px"}}}} -->
19-
<div class="wp-block-columns ai-footer-top wide" style="margin-top:32px;margin-bottom:32px"><!-- wp:column -->
20-
<div class="wp-block-column"><!-- wp:image {"id":25020,"width":"270px","sizeSlug":"large","linkDestination":"none","align":"center"} -->
21-
<figure class="wp-block-image aligncenter size-large is-resized"><img src="$image_url" alt="" class="wp-image-25020" style="width:270px"/></figure>
22-
<!-- /wp:image --></div>
23-
<!-- /wp:column -->
24-
25-
<!-- wp:column -->
26-
<div class="wp-block-column"><!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
27-
<div class="wp-block-buttons"><!-- wp:button {"textColor":"neutral-white","className":"is-style-spin-green","style":{"elements":{"link":{"color":{"text":"var:preset|color|neutral-white"}}}}} -->
28-
<div class="wp-block-button is-style-spin-green"><a class="wp-block-button__link has-neutral-white-color has-text-color has-link-color wp-element-button">Join us</a></div>
29-
<!-- /wp:button --></div>
30-
<!-- /wp:buttons --></div>
31-
<!-- /wp:column -->
32-
33-
<!-- wp:column -->
34-
<div class="wp-block-column"><!-- wp:shortcode -->
35-
[jetpack-social]
36-
<!-- /wp:shortcode --></div>
37-
<!-- /wp:column --></div>
38-
<!-- /wp:columns -->
39-
40-
<!-- wp:columns {"className":"ai-footer-bottom wide"} -->
41-
<div class="wp-block-columns ai-footer-bottom wide"><!-- wp:column {"width":"30%"} -->
42-
<div class="wp-block-column" style="flex-basis:30%"><!-- wp:heading {"level":5} -->
43-
<h5 class="wp-block-heading">The Open Source Initiative</h5>
44-
<!-- /wp:heading -->
45-
46-
<!-- wp:paragraph -->
47-
<p>The OSI is the authority that defines Open Source, recognized globally by individuals, companies, and by public institutions.</p>
48-
<!-- /wp:paragraph -->
49-
50-
<!-- wp:shortcode -->
51-
[jetpack-social]
52-
<!-- /wp:shortcode --></div>
53-
<!-- /wp:column -->
54-
55-
<!-- wp:column {"width":"20%"} -->
56-
<div class="wp-block-column" style="flex-basis:20%"><!-- wp:heading {"level":5} -->
57-
<h5 class="wp-block-heading">About</h5>
58-
<!-- /wp:heading -->
59-
60-
<!-- wp:list -->
61-
<ul class="wp-block-list"><!-- wp:list-item -->
62-
<li><a href="https://opensource.org/about"><span class="dashicons dashicons-arrow-right-alt2"></span>About Us</a></li>
63-
<!-- /wp:list-item -->
64-
65-
<!-- wp:list-item -->
66-
<li><a href="https://opensource.org/about/team"><span class="dashicons dashicons-arrow-right-alt2"></span>Our team</a></li>
67-
<!-- /wp:list-item -->
68-
69-
<!-- wp:list-item -->
70-
<li><a href="https://opensource.org/associations"><span class="dashicons dashicons-arrow-right-alt2"></span>Associations</a></li>
71-
<!-- /wp:list-item -->
72-
73-
<!-- wp:list-item -->
74-
<li><a href="https://opensource.org/sponsors"><span class="dashicons dashicons-arrow-right-alt2"></span>Sponsors</a></li>
75-
<!-- /wp:list-item -->
76-
77-
<!-- wp:list-item -->
78-
<li><a href="https://opensource.org/articles-of-incorporation"><span class="dashicons dashicons-arrow-right-alt2"></span>Articles of Incorporation</a></li>
79-
<!-- /wp:list-item -->
80-
81-
<!-- wp:list-item -->
82-
<li><a href="https://opensource.org/bylaws"><span class="dashicons dashicons-arrow-right-alt2"></span>Bylaws</a></li>
83-
<!-- /wp:list-item -->
84-
85-
<!-- wp:list-item -->
86-
<li><a href="https://opensource.org/history"><span class="dashicons dashicons-arrow-right-alt2"></span>History</a></li>
87-
<!-- /wp:list-item -->
88-
89-
<!-- wp:list-item -->
90-
<li><a href="https://opensource.org/trademark-guidelines"><span class="dashicons dashicons-arrow-right-alt2"></span>Trademark Guidelines</a></li>
91-
<!-- /wp:list-item --></ul>
92-
<!-- /wp:list --></div>
93-
<!-- /wp:column -->
94-
95-
<!-- wp:column {"width":"20%"} -->
96-
<div class="wp-block-column" style="flex-basis:20%"><!-- wp:heading {"level":5} -->
97-
<h5 class="wp-block-heading">Licenses</h5>
98-
<!-- /wp:heading -->
99-
100-
<!-- wp:list -->
101-
<ul class="wp-block-list"><!-- wp:list-item -->
102-
<li><a href="https://opensource.org/osd"><span class="dashicons dashicons-arrow-right-alt2"></span>Open Source Definition</a></li>
103-
<!-- /wp:list-item -->
104-
105-
<!-- wp:list-item -->
106-
<li><a href="https://opensource.org/licenses"><span class="dashicons dashicons-arrow-right-alt2"></span>Licenses</a></li>
107-
<!-- /wp:list-item -->
108-
109-
<!-- wp:list-item -->
110-
<li><a href="https://opensource.org/licenses/review-process"><span class="dashicons dashicons-arrow-right-alt2"></span>License Review Process</a></li>
111-
<!-- /wp:list-item -->
112-
113-
<!-- wp:list-item -->
114-
<li><a href="https://opensource.org/osr"><span class="dashicons dashicons-arrow-right-alt2"></span>Open Standards Requirement for Software</a></li>
115-
<!-- /wp:list-item --></ul>
116-
<!-- /wp:list --></div>
117-
<!-- /wp:column -->
118-
119-
<!-- wp:column {"width":"20%"} -->
120-
<div class="wp-block-column" style="flex-basis:20%"><!-- wp:heading {"level":5} -->
121-
<h5 class="wp-block-heading">Board</h5>
122-
<!-- /wp:heading -->
123-
124-
<!-- wp:list -->
125-
<ul class="wp-block-list"><!-- wp:list-item -->
126-
<li><a href="https://opensource.org/about/board-of-directors"><span class="dashicons dashicons-arrow-right-alt2"></span>Board of Directors</a></li>
127-
<!-- /wp:list-item -->
128-
129-
<!-- wp:list-item -->
130-
<li><a href="https://opensource.org/minutes"><span class="dashicons dashicons-arrow-right-alt2"></span>Minutes</a></li>
131-
<!-- /wp:list-item -->
132-
133-
<!-- wp:list-item -->
134-
<li><a href="https://opensource.org/about/board-of-directors/elections"><span class="dashicons dashicons-arrow-right-alt2"></span>Elections</a></li>
135-
<!-- /wp:list-item -->
136-
137-
<!-- wp:list-item -->
138-
<li><a href="https://opensource.org/organization"><span class="dashicons dashicons-arrow-right-alt2"></span>Organization &amp; Operations</a></li>
139-
<!-- /wp:list-item -->
140-
141-
<!-- wp:list-item -->
142-
<li><a href="https://opensource.org/conflict_of_interest_policy"><span class="dashicons dashicons-arrow-right-alt2"></span>Conflict of Interest Policy</a></li>
143-
<!-- /wp:list-item -->
144-
145-
<!-- wp:list-item -->
146-
<li><a href="https://opensource.org/board/board-member-agreement"><span class="dashicons dashicons-arrow-right-alt2"></span>Board member agreement</a></li>
147-
<!-- /wp:list-item --></ul>
148-
<!-- /wp:list --></div>
149-
<!-- /wp:column --></div>
150-
<!-- /wp:columns --></div>
151-
<!-- /wp:group --></div>
152-
<!-- /wp:group -->
153-
HTML;
11+
$footer_block_id = osi_create_or_find_ai_footer_block_content();
15412
?>
15513

156-
<footer id="colophon" class="footer site-footer ai-footer" role="contentinfo">
157-
<?php echo do_shortcode( do_blocks( $footer_block ) ); ?>
158-
<section class="footer-credits">
159-
<div class="footer--inner">
160-
<div class="widgetized-footer footer--widgets wp-block-columns alignwide">
161-
<?php dynamic_sidebar( 'sidebar-footer-secondary' ); ?>
162-
<div class="wp-block-column">
163-
<p class="footer--extra-text">
164-
<?php
165-
if ( is_active_sidebar( 'footer-above-credits' ) ) {
166-
dynamic_sidebar( 'footer-above-credits' );
167-
}
168-
?>
169-
<?php do_action( 'osi_credits' ); ?>
170-
</p><!-- .powered-by-wordpress -->
171-
</div>
14+
<footer id="colophon" class="footer site-footer ai-footer" role="contentinfo">
15+
<?php echo do_shortcode( do_blocks( '<!-- wp:block {"ref":' . absint( $footer_block_id ) . '} /-->' ) ); ?>
16+
<section class="footer-credits">
17+
<div class="footer--inner">
18+
<div class="widgetized-footer footer--widgets wp-block-columns alignwide">
19+
<?php dynamic_sidebar( 'sidebar-footer-secondary' ); ?>
20+
<div class="wp-block-column">
21+
<p class="footer--extra-text">
22+
<?php
23+
if ( is_active_sidebar( 'footer-above-credits' ) ) {
24+
dynamic_sidebar( 'footer-above-credits' );
25+
}
26+
?>
27+
<?php do_action( 'osi_credits' ); ?>
28+
</p><!-- .powered-by-wordpress -->
17229
</div>
17330
</div>
174-
</section>
175-
</footer><!-- #colophon -->
31+
</div>
32+
</section>
33+
</footer><!-- #colophon -->
17634

177-
</div><!-- #page -->
35+
</div><!-- #page -->
17836

17937
<?php wp_footer(); ?>
18038

18139
</body>
182-
</html>
40+
</html>

themes/osi/functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,5 +568,6 @@ function osi_full_width_editor( array $editor_settings ): array {
568568
*/
569569
function osi_register_ai_menu() {
570570
register_nav_menu( 'ai', __( 'AI Menu', 'osi' ) );
571+
register_nav_menu( 'ai_secondary_nav', __( 'AI Secondary Navigation', 'osi' ) );
571572
}
572573
add_action( 'after_setup_theme', 'osi_register_ai_menu' );

0 commit comments

Comments
 (0)