Files
AsterionWP2026/wp-content/themes/asterion-bricks/header.php
j.foucher 026be81373 chore: session 2 snapshot — archive before Bricks-first restart
Snapshots the project at the end of session 2, just before resetting to a
Bricks-first orthodox architecture. RESTART-PLAN.md at the root explains
why this approach is being abandoned and what the next session will look like.

Why we restart
- Three architectures got stacked: Custom PHP Templates → Gutenberg blocks
  in post_content → Bricks data in post meta. Each layer fights the next.
- Bricks Builder UI does not load because our header.php / footer.php /
  page.php emit chrome that conflicts with Bricks' own template-parts.
- CSS overrides multiplied (Gutenberg + Bricks variants) and still don't
  pixel-match the original PHP-rendered visual.
- 8+ one-shot mu-plugins live in LocalWP to patch over inconsistencies.

What survives the restart (preserved here on main)
- BRIEF, both PDFs, .txt extracts (sources of truth)
- assets/css/tokens.css (full design system, untouched)
- assets/fonts/Inter-Variable*.woff2 (RGPD self-hosted)
- inc/<section>-data.php files (text copy from PDF strategie, will become
  /content-source/ on next session for reuse as translation dictionary
  and as input to programmatic page generation)
- The Git repo, remote, branch main
- LocalWP site, Bricks v2.3.4, WPML 4.9.3 with active licenses
- WPML EN + FR setup with directory URL strategy

What gets wiped at the start of next session
- wp-content/themes/asterion-bricks/header.php / footer.php / page.php /
  index.php / front-page.php / template-parts/ / templates/
- inc/render-blocks.php, inc/render-blocks-native.php, inc/render-bricks.php
- inc/shortcodes.php, inc/i18n.php, inc/form-handler.php
- 35+ WP pages created over the session
- All one-shot mu-plugins in LocalWP/wp-content/mu-plugins/

Restart approach (detailed in RESTART-PLAN.md)
- Minimalist child theme: style.css, functions.php, theme.json, tokens.css,
  trimmed utilities.css, fonts, inc/cpt.php — that's it.
- No header.php / footer.php / page.php in child theme — Bricks Templates
  (Header / Footer / Single — Page) take over via Bricks' Conditions.
- User builds 5-7 archetype Bricks templates visually (~1-2h each) then
  programmatic generation fills the variants from inc/*-data.php sources.
- WPML duplication after EN is validated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 14:30:51 +02:00

139 lines
6.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Asterion Bricks — Global header
*
* Sticky header per Design Handoff section 3.5 :
* - 60px on mobile, 72px on desktop
* - Logo left, main nav center (desktop), CTA + lang switch right
* - Hamburger drawer on mobile
*
* @package AsterionBricks
*/
defined('ABSPATH') || exit;
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#0B1F3A">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php
// In Bricks Builder mode, the parent theme's `template-parts/builder.php`
// calls get_header() / get_footer() to inherit our enqueues — but the
// builder UI then mounts directly into <body>. Emitting our own chrome
// here covers it visually, so we bail early.
if (function_exists('bricks_is_builder') && bricks_is_builder()) {
return;
}
?>
<a class="av-skip-link" href="#main"><?php echo esc_html(av_t('Skip to main content', 'asterion-bricks')); ?></a>
<header class="av-header" role="banner">
<div class="av-container av-header__inner">
<a href="<?php echo esc_url(home_url('/')); ?>" class="av-header__logo" aria-label="Asterion VR — home">
ASTERION&nbsp;VR
</a>
<nav class="av-nav" aria-label="<?php esc_attr_e('Primary', 'asterion-bricks'); ?>">
<ul class="av-nav__list" style="display:flex;gap:var(--space-6);list-style:none;margin:0;padding:0;">
<li class="av-nav__item">
<a href="<?php echo esc_url(home_url('/solutions/')); ?>" class="av-nav__link" aria-haspopup="true" aria-expanded="false">
<?php echo esc_html(av_t('Solutions', 'asterion-bricks')); ?>
</a>
</li>
<li class="av-nav__item">
<a href="<?php echo esc_url(home_url('/industries/')); ?>" class="av-nav__link" aria-haspopup="true" aria-expanded="false">
<?php echo esc_html(av_t('Industries', 'asterion-bricks')); ?>
</a>
</li>
<li class="av-nav__item">
<a href="<?php echo esc_url(home_url('/technology/')); ?>" class="av-nav__link" aria-haspopup="true" aria-expanded="false">
<?php echo esc_html(av_t('Technology', 'asterion-bricks')); ?>
</a>
</li>
<li class="av-nav__item">
<a href="<?php echo esc_url(home_url('/why-asterion/')); ?>" class="av-nav__link">
<?php echo esc_html(av_t('Why Asterion', 'asterion-bricks')); ?>
</a>
</li>
<li class="av-nav__item">
<a href="<?php echo esc_url(home_url('/insights/')); ?>" class="av-nav__link">
<?php echo esc_html(av_t('Insights', 'asterion-bricks')); ?>
</a>
</li>
</ul>
</nav>
<div class="av-header__right">
<?php
// Render WPML language switcher when WPML is active and exposes languages.
$av_languages = apply_filters('wpml_active_languages', null, ['skip_missing' => 0]);
if (! empty($av_languages) && is_array($av_languages) && count($av_languages) > 1) :
?>
<div class="av-lang-switch" aria-label="<?php echo esc_attr(av_t('Language')); ?>">
<?php $av_first = true; foreach ($av_languages as $av_lang_data) :
if (! $av_first) : ?><span aria-hidden="true">·</span><?php endif; $av_first = false;
$av_code = strtoupper($av_lang_data['language_code']);
$av_url = esc_url($av_lang_data['url']);
$av_label = esc_html($av_lang_data['translated_name'] ?? $av_lang_data['native_name'] ?? $av_code);
if (! empty($av_lang_data['active'])) : ?>
<span class="av-lang-switch__current" aria-current="true"><?php echo esc_html($av_code); ?></span>
<?php else : ?>
<a href="<?php echo $av_url; ?>" class="av-lang-switch__other" hreflang="<?php echo esc_attr($av_lang_data['language_code']); ?>" lang="<?php echo esc_attr($av_lang_data['language_code']); ?>" aria-label="<?php echo esc_attr($av_label); ?>"><?php echo esc_html($av_code); ?></a>
<?php endif;
endforeach; ?>
</div>
<?php endif; ?>
<a href="<?php echo esc_url(home_url('/request-demo/')); ?>" class="av-btn av-btn--primary av-btn--md">
<?php echo esc_html(av_t('Request a Demo', 'asterion-bricks')); ?>
</a>
<button type="button" class="av-drawer-toggle" aria-controls="av-drawer" aria-expanded="false" aria-label="<?php esc_attr_e('Open menu', 'asterion-bricks'); ?>">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</div>
</div>
</header>
<aside id="av-drawer" class="av-drawer" aria-hidden="true">
<button type="button" class="av-drawer__close" aria-label="<?php esc_attr_e('Close menu', 'asterion-bricks'); ?>">×</button>
<nav class="av-drawer__nav" aria-label="<?php esc_attr_e('Mobile primary', 'asterion-bricks'); ?>">
<div class="av-drawer__group">
<a href="<?php echo esc_url(home_url('/solutions/')); ?>" class="av-drawer__group-title"><?php echo esc_html(av_t('Solutions', 'asterion-bricks')); ?></a>
</div>
<div class="av-drawer__group">
<a href="<?php echo esc_url(home_url('/industries/')); ?>" class="av-drawer__group-title"><?php echo esc_html(av_t('Industries', 'asterion-bricks')); ?></a>
</div>
<div class="av-drawer__group">
<a href="<?php echo esc_url(home_url('/technology/')); ?>" class="av-drawer__group-title"><?php echo esc_html(av_t('Technology', 'asterion-bricks')); ?></a>
</div>
<div class="av-drawer__group">
<a href="<?php echo esc_url(home_url('/why-asterion/')); ?>" class="av-drawer__group-title"><?php echo esc_html(av_t('Why Asterion', 'asterion-bricks')); ?></a>
</div>
<div class="av-drawer__group">
<a href="<?php echo esc_url(home_url('/insights/')); ?>" class="av-drawer__group-title"><?php echo esc_html(av_t('Insights', 'asterion-bricks')); ?></a>
</div>
</nav>
<div class="av-drawer__cta-area">
<a href="<?php echo esc_url(home_url('/request-demo/')); ?>" class="av-btn av-btn--primary av-btn--lg" style="width:100%;">
<?php echo esc_html(av_t('Request a Demo', 'asterion-bricks')); ?>
</a>
</div>
</aside>
<main id="main" class="av-main">