From 5bae6de6ba10adb81aaacdebe6988d2ab158e749 Mon Sep 17 00:00:00 2001 From: r00bbert <280805750+r00bbert@users.noreply.github.com> Date: Thu, 21 May 2026 23:50:19 +0200 Subject: [PATCH 1/3] Keep nav menu and Ask AI button in single policy view Fixes #24. Extract nav into shared templates/partials/nav.php used by both the main page and policy view. Policy view renders the full menu + Ask AI; section links point back to the main page, scroll-spy off there. Re-applies PR #26 onto post-rename templates. --- languages/open-trust-center-by-ettic-nl_NL.po | 57 +++++++++--------- languages/open-trust-center-by-ettic.pot | 57 +++++++++--------- templates/partials/nav.php | 58 ++++++++++++++++++ templates/partials/policy-single.php | 22 +++---- templates/trust-center.php | 60 +++++-------------- 5 files changed, 136 insertions(+), 118 deletions(-) create mode 100644 templates/partials/nav.php diff --git a/languages/open-trust-center-by-ettic-nl_NL.po b/languages/open-trust-center-by-ettic-nl_NL.po index fe84f9c..894ff09 100644 --- a/languages/open-trust-center-by-ettic-nl_NL.po +++ b/languages/open-trust-center-by-ettic-nl_NL.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: Open Trust Center by Ettic 1.2.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/open-trust-center-" "by-ettic\n" -"POT-Creation-Date: 2026-05-21T21:07:30+00:00\n" +"POT-Creation-Date: 2026-05-21T21:49:50+00:00\n" "PO-Revision-Date: 2026-04-14 21:55+0000\n" "Last-Translator: Ettic bundled starter \n" "Language-Team: Dutch (Netherlands)\n" @@ -857,7 +857,7 @@ msgstr "Certificeringen & compliance" #: includes/class-ettic-otc-admin-tools.php:592 #: includes/class-ettic-otc-cpt.php:271 includes/class-ettic-otc-cpt.php:281 #: templates/chat.php:45 templates/partials/hero.php:55 -#: templates/trust-center.php:107 +#: templates/trust-center.php:70 #, fuzzy msgid "Policies" msgstr "Beleid" @@ -866,7 +866,7 @@ msgstr "Beleid" #: includes/class-ettic-otc-admin-tools.php:594 #: includes/class-ettic-otc-cpt.php:338 includes/class-ettic-otc-cpt.php:347 #: templates/chat.php:47 templates/partials/hero.php:61 -#: templates/partials/subprocessors.php:20 templates/trust-center.php:109 +#: templates/partials/subprocessors.php:20 templates/trust-center.php:72 #, fuzzy msgid "Subprocessors" msgstr "Subverwerkers" @@ -875,7 +875,7 @@ msgstr "Subverwerkers" #: includes/class-ettic-otc-admin-tools.php:595 #: includes/class-ettic-otc-cpt.php:371 includes/class-ettic-otc-cpt.php:380 #: templates/chat.php:48 templates/partials/data-practices.php:34 -#: templates/trust-center.php:110 +#: templates/trust-center.php:73 #, fuzzy msgid "Data Practices" msgstr "Gegevensverwerking" @@ -900,7 +900,7 @@ msgid "General" msgstr "" #: includes/class-ettic-otc-admin-settings.php:597 templates/chat.php:60 -#: templates/trust-center.php:111 +#: templates/trust-center.php:74 msgid "Contact" msgstr "" @@ -1069,7 +1069,7 @@ msgstr "" #: includes/class-ettic-otc-admin-tools.php:593 #: includes/class-ettic-otc-cpt.php:305 includes/class-ettic-otc-cpt.php:314 #: templates/chat.php:46 templates/partials/hero.php:49 -#: templates/trust-center.php:108 +#: templates/trust-center.php:71 #, fuzzy msgid "Certifications" msgstr "Certificeringen" @@ -1417,7 +1417,7 @@ msgid "No data practices in trash." msgstr "" #: includes/class-ettic-otc-cpt.php:405 templates/chat.php:61 -#: templates/trust-center.php:112 +#: templates/trust-center.php:75 msgid "FAQ" msgstr "" @@ -1928,7 +1928,7 @@ msgid "Page not found." msgstr "" #: includes/class-ettic-otc-render.php:271 -#: templates/partials/policy-single.php:54 +#: templates/partials/policy-single.php:46 #, fuzzy msgid "Back to Trust Center" msgstr "Terug naar Trust Center" @@ -1964,7 +1964,7 @@ msgstr[1] "%d dagen geleden bijgewerkt" #. translators: %s = formatted date #. translators: %s: policy last updated date #: includes/class-ettic-otc-render.php:467 -#: templates/partials/policy-single.php:111 +#: templates/partials/policy-single.php:103 #, fuzzy, php-format msgid "Updated %s" msgstr "Bijgewerkt op %s" @@ -2053,7 +2053,7 @@ msgid "Actions" msgstr "Acties" #: includes/class-ettic-otc-version.php:169 -#: templates/partials/policy-single.php:174 +#: templates/partials/policy-single.php:166 msgid "Current" msgstr "" @@ -2385,16 +2385,15 @@ msgstr "" msgid "Ask %s — Trust Center" msgstr "Vraag het aan %s — Trust Center" -#: templates/chat.php:100 templates/trust-center.php:101 +#: templates/chat.php:100 templates/trust-center.php:111 msgid "Skip to content" msgstr "" -#: templates/chat.php:102 templates/partials/policy-single.php:36 -#: templates/trust-center.php:114 +#: templates/chat.php:102 templates/partials/nav.php:22 msgid "Trust center navigation" msgstr "" -#: templates/chat.php:131 templates/trust-center.php:144 +#: templates/chat.php:131 templates/partials/nav.php:53 #, fuzzy msgid "Ask AI" msgstr "Vraag de AI" @@ -2534,7 +2533,7 @@ msgstr "Kopiëren" msgid "Copied" msgstr "Gekopieerd" -#: templates/chat.php:343 templates/partials/policy-single.php:139 +#: templates/chat.php:343 templates/partials/policy-single.php:131 #, fuzzy msgid "Print" msgstr "Afdrukken" @@ -2743,23 +2742,23 @@ msgstr "" msgid "Last Updated" msgstr "Laatst bijgewerkt" -#: templates/partials/policies.php:89 templates/partials/policy-single.php:116 +#: templates/partials/policies.php:89 templates/partials/policy-single.php:108 msgid "Framework citations" msgstr "" #. translators: %s: policy version number -#: templates/partials/policies.php:99 templates/partials/policy-single.php:94 +#: templates/partials/policies.php:99 templates/partials/policy-single.php:86 #, fuzzy, php-format msgid "v%s" msgstr "v%s" #. translators: %s: human-readable file size -#: templates/partials/policies.php:106 templates/partials/policy-single.php:130 +#: templates/partials/policies.php:106 templates/partials/policy-single.php:122 #, php-format msgid "Download PDF (%s)" msgstr "" -#: templates/partials/policies.php:108 templates/partials/policy-single.php:132 +#: templates/partials/policies.php:108 templates/partials/policy-single.php:124 #, fuzzy msgid "Download PDF" msgstr "Download PDF" @@ -2771,37 +2770,37 @@ msgid "View %s" msgstr "%s bekijken" #. translators: %1$s: version number, %2$s: link to current version -#: templates/partials/policy-single.php:63 +#: templates/partials/policy-single.php:55 #, fuzzy, php-format msgid "You are viewing version %1$s. %2$s" msgstr "Je bekijkt versie %1$s. %2$s" -#: templates/partials/policy-single.php:65 -#: templates/partials/policy-single.php:78 +#: templates/partials/policy-single.php:57 +#: templates/partials/policy-single.php:70 #, fuzzy msgid "View current version" msgstr "Huidige versie bekijken" #. translators: %1$s: effective date, %2$s: link to previous version -#: templates/partials/policy-single.php:75 +#: templates/partials/policy-single.php:67 #, fuzzy, php-format msgid "This version takes effect on %1$s. %2$s" msgstr "Deze versie gaat in op %1$s. %2$s" #. translators: %s: policy effective date -#: templates/partials/policy-single.php:105 +#: templates/partials/policy-single.php:97 #, php-format msgid "Effective %s" msgstr "" #. translators: %d: number of policy versions -#: templates/partials/policy-single.php:150 +#: templates/partials/policy-single.php:142 #, fuzzy, php-format msgid "Version history (%d)" msgstr "Versiegeschiedenis (%d)" #. translators: %d: version number -#: templates/partials/policy-single.php:166 +#: templates/partials/policy-single.php:158 #, fuzzy, php-format msgid "v%d" msgstr "v%d" @@ -2836,17 +2835,17 @@ msgstr "Ondertekend" msgid "Transparency and security you can trust." msgstr "Transparante beveiliging om op te vertrouwen." -#: templates/trust-center.php:196 +#: templates/trust-center.php:166 msgid "Trust center content is being prepared. Check back soon." msgstr "" #. translators: %s: company name -#: templates/trust-center.php:212 +#: templates/trust-center.php:182 #, fuzzy, php-format msgid "© %1$s %2$s. All rights reserved." msgstr "© %1$s %2$s. Alle rechten voorbehouden." -#: templates/trust-center.php:220 +#: templates/trust-center.php:190 msgid "Powered by Open Trust Center" msgstr "" diff --git a/languages/open-trust-center-by-ettic.pot b/languages/open-trust-center-by-ettic.pot index 6c3c134..a8af2d9 100644 --- a/languages/open-trust-center-by-ettic.pot +++ b/languages/open-trust-center-by-ettic.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2026-05-21T21:07:30+00:00\n" +"POT-Creation-Date: 2026-05-21T21:49:50+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.12.0\n" "X-Domain: open-trust-center-by-ettic\n" @@ -764,7 +764,7 @@ msgstr "" #: includes/class-ettic-otc-cpt.php:281 #: templates/chat.php:45 #: templates/partials/hero.php:55 -#: templates/trust-center.php:107 +#: templates/trust-center.php:70 msgid "Policies" msgstr "" @@ -775,7 +775,7 @@ msgstr "" #: templates/chat.php:47 #: templates/partials/hero.php:61 #: templates/partials/subprocessors.php:20 -#: templates/trust-center.php:109 +#: templates/trust-center.php:72 msgid "Subprocessors" msgstr "" @@ -785,7 +785,7 @@ msgstr "" #: includes/class-ettic-otc-cpt.php:380 #: templates/chat.php:48 #: templates/partials/data-practices.php:34 -#: templates/trust-center.php:110 +#: templates/trust-center.php:73 msgid "Data Practices" msgstr "" @@ -811,7 +811,7 @@ msgstr "" #: includes/class-ettic-otc-admin-settings.php:597 #: templates/chat.php:60 -#: templates/trust-center.php:111 +#: templates/trust-center.php:74 msgid "Contact" msgstr "" @@ -974,7 +974,7 @@ msgstr "" #: includes/class-ettic-otc-cpt.php:314 #: templates/chat.php:46 #: templates/partials/hero.php:49 -#: templates/trust-center.php:108 +#: templates/trust-center.php:71 msgid "Certifications" msgstr "" @@ -1306,7 +1306,7 @@ msgstr "" #: includes/class-ettic-otc-cpt.php:405 #: templates/chat.php:61 -#: templates/trust-center.php:112 +#: templates/trust-center.php:75 msgid "FAQ" msgstr "" @@ -1782,7 +1782,7 @@ msgid "Page not found." msgstr "" #: includes/class-ettic-otc-render.php:271 -#: templates/partials/policy-single.php:54 +#: templates/partials/policy-single.php:46 msgid "Back to Trust Center" msgstr "" @@ -1817,7 +1817,7 @@ msgstr[1] "" #. translators: %s = formatted date #. translators: %s: policy last updated date #: includes/class-ettic-otc-render.php:467 -#: templates/partials/policy-single.php:111 +#: templates/partials/policy-single.php:103 #, php-format msgid "Updated %s" msgstr "" @@ -1904,7 +1904,7 @@ msgid "Actions" msgstr "" #: includes/class-ettic-otc-version.php:169 -#: templates/partials/policy-single.php:174 +#: templates/partials/policy-single.php:166 msgid "Current" msgstr "" @@ -2176,18 +2176,17 @@ msgid "Ask %s — Trust Center" msgstr "" #: templates/chat.php:100 -#: templates/trust-center.php:101 +#: templates/trust-center.php:111 msgid "Skip to content" msgstr "" #: templates/chat.php:102 -#: templates/partials/policy-single.php:36 -#: templates/trust-center.php:114 +#: templates/partials/nav.php:22 msgid "Trust center navigation" msgstr "" #: templates/chat.php:131 -#: templates/trust-center.php:144 +#: templates/partials/nav.php:53 msgid "Ask AI" msgstr "" @@ -2310,7 +2309,7 @@ msgid "Copied" msgstr "" #: templates/chat.php:343 -#: templates/partials/policy-single.php:139 +#: templates/partials/policy-single.php:131 msgid "Print" msgstr "" @@ -2487,26 +2486,26 @@ msgid "Last Updated" msgstr "" #: templates/partials/policies.php:89 -#: templates/partials/policy-single.php:116 +#: templates/partials/policy-single.php:108 msgid "Framework citations" msgstr "" #. translators: %s: policy version number #: templates/partials/policies.php:99 -#: templates/partials/policy-single.php:94 +#: templates/partials/policy-single.php:86 #, php-format msgid "v%s" msgstr "" #. translators: %s: human-readable file size #: templates/partials/policies.php:106 -#: templates/partials/policy-single.php:130 +#: templates/partials/policy-single.php:122 #, php-format msgid "Download PDF (%s)" msgstr "" #: templates/partials/policies.php:108 -#: templates/partials/policy-single.php:132 +#: templates/partials/policy-single.php:124 msgid "Download PDF" msgstr "" @@ -2517,36 +2516,36 @@ msgid "View %s" msgstr "" #. translators: %1$s: version number, %2$s: link to current version -#: templates/partials/policy-single.php:63 +#: templates/partials/policy-single.php:55 #, php-format msgid "You are viewing version %1$s. %2$s" msgstr "" -#: templates/partials/policy-single.php:65 -#: templates/partials/policy-single.php:78 +#: templates/partials/policy-single.php:57 +#: templates/partials/policy-single.php:70 msgid "View current version" msgstr "" #. translators: %1$s: effective date, %2$s: link to previous version -#: templates/partials/policy-single.php:75 +#: templates/partials/policy-single.php:67 #, php-format msgid "This version takes effect on %1$s. %2$s" msgstr "" #. translators: %s: policy effective date -#: templates/partials/policy-single.php:105 +#: templates/partials/policy-single.php:97 #, php-format msgid "Effective %s" msgstr "" #. translators: %d: number of policy versions -#: templates/partials/policy-single.php:150 +#: templates/partials/policy-single.php:142 #, php-format msgid "Version history (%d)" msgstr "" #. translators: %d: version number -#: templates/partials/policy-single.php:166 +#: templates/partials/policy-single.php:158 #, php-format msgid "v%d" msgstr "" @@ -2572,16 +2571,16 @@ msgstr "" msgid "Transparency and security you can trust." msgstr "" -#: templates/trust-center.php:196 +#: templates/trust-center.php:166 msgid "Trust center content is being prepared. Check back soon." msgstr "" #. translators: %s: company name -#: templates/trust-center.php:212 +#: templates/trust-center.php:182 #, php-format msgid "© %1$s %2$s. All rights reserved." msgstr "" -#: templates/trust-center.php:220 +#: templates/trust-center.php:190 msgid "Powered by Open Trust Center" msgstr "" diff --git a/templates/partials/nav.php b/templates/partials/nav.php new file mode 100644 index 0000000..ab8f68b --- /dev/null +++ b/templates/partials/nav.php @@ -0,0 +1,58 @@ + + diff --git a/templates/partials/policy-single.php b/templates/partials/policy-single.php index e475baa..a7fc179 100644 --- a/templates/partials/policy-single.php +++ b/templates/partials/policy-single.php @@ -2,7 +2,7 @@ /** * Single policy view partial. * - * Variables available from parent: $ot_data, $ot_settings, $ot_base_url, $ot_logo_url, $ot_company_name + * Variables available from parent: $ot_data, $ot_settings, $ot_base_url, $ot_logo_url, $ot_company_name, $ot_ai_enabled, $ot_nav_items */ declare(strict_types=1); @@ -31,21 +31,13 @@ $ot_modified_date = wp_date(get_option('date_format'), strtotime($ot_policy->post_modified)); $ot_current_url = trailingslashit($ot_base_url) . 'policy/' . $ot_policy->post_name . '/'; -?> - +// Section links jump back to the main trust center page; scroll-spy is off +// since those sections don't exist on this page. +$ot_nav_anchor_base = $ot_base_url; +$ot_nav_scrollspy = false; +include ETTIC_OTC_PLUGIN_DIR . 'templates/partials/nav.php'; +?>
diff --git a/templates/trust-center.php b/templates/trust-center.php index cb809f2..62bf1f3 100644 --- a/templates/trust-center.php +++ b/templates/trust-center.php @@ -63,6 +63,16 @@ $ot_accent_l_safe = !empty($ot_settings['accent_force_exact']) ? (int) $ot_hsl['l'] : Ettic_OTC::accent_safe_lightness((string) ($ot_settings['accent_color'] ?? '#2563EB')); + +// Navigation items — shared by the main page and the single policy view so +// the menu stays put when a visitor drills into a policy. +$ot_nav_items = []; +if (!empty($ot_visible['policies']) && $ot_policy_count) $ot_nav_items['policies'] = __('Policies', 'open-trust-center-by-ettic'); +if (!empty($ot_visible['certifications']) && $ot_cert_count) $ot_nav_items['certifications'] = __('Certifications', 'open-trust-center-by-ettic'); +if (!empty($ot_visible['subprocessors']) && $ot_sub_count) $ot_nav_items['subprocessors'] = __('Subprocessors', 'open-trust-center-by-ettic'); +if (!empty($ot_visible['data_practices']) && count($ot_data['data_practices'] ?? [])) $ot_nav_items['data-practices'] = __('Data Practices', 'open-trust-center-by-ettic'); +if (!empty($ot_visible['contact']) && $ot_contact_has_content) $ot_nav_items['contact'] = __('Contact', 'open-trust-center-by-ettic'); +if (!empty($ot_visible['faqs']) && $ot_faq_count) $ot_nav_items['faqs'] = __('FAQ', 'open-trust-center-by-ettic'); ?> > @@ -103,51 +113,11 @@ - - From 9ee7335fee619605e152fae89bc273e2b5bdb5a4 Mon Sep 17 00:00:00 2001 From: r00bbert <280805750+r00bbert@users.noreply.github.com> Date: Thu, 21 May 2026 23:54:38 +0200 Subject: [PATCH 2/3] nav: keep accessible brand name when logo has no company name Fall back to site name for the logo alt so the brand link always has an accessible label. Addresses CodeRabbit a11y note. --- templates/partials/nav.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/partials/nav.php b/templates/partials/nav.php index ab8f68b..d3532a8 100644 --- a/templates/partials/nav.php +++ b/templates/partials/nav.php @@ -18,6 +18,7 @@ $ot_nav_anchor_base = $ot_nav_anchor_base ?? ''; $ot_nav_scrollspy = $ot_nav_scrollspy ?? false; +$ot_brand_name = (string) ($ot_company_name ?: get_bloginfo('name')); ?>