Fix unstyled pages: rename base.html.twig to avoid parent collision

The child's templates/base.html.twig was shadowing the parent's
views/base.html.twig (full HTML page shell) because prependPath()
made Twig find the child's minimal wrapper first. Rename to
wc-base.html.twig so the parent's page shell renders correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 12:29:20 +01:00
parent c0d1dc85c4
commit c3b16b68c5
9 changed files with 10 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block breadcrumbs %}
{{ do_action('woocommerce_before_main_content') }}

View File

@@ -2,7 +2,7 @@
# Shop Breadcrumb (Bootstrap 5 Override)
#
# Replaces WooCommerce's breadcrumb with Bootstrap 5 breadcrumb component.
# Skipped when parent theme is wrapping (base.html.twig handles breadcrumbs).
# Skipped when parent theme is wrapping (wc-base.html.twig handles breadcrumbs).
#
# Expected context (from WooCommerce woocommerce_breadcrumb()):
# breadcrumb - Array of [label, url] tuples

View File

@@ -3,7 +3,7 @@
#
# Replaces WooCommerce's theme-specific wrapper divs with Bootstrap 5 layout.
# When the parent theme wraps the page (_theme_wrapped), this outputs nothing
# since base.html.twig already provides the container.
# since wc-base.html.twig already provides the container.
#
# WooCommerce PHP equivalent: global/wrapper-start.php
#

View File

@@ -7,7 +7,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block content %}
<div class="mb-4">

View File

@@ -8,7 +8,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block content %}
<div class="mb-4">

View File

@@ -8,7 +8,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block content %}
<div class="row justify-content-center">

View File

@@ -7,7 +7,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block content %}
<div class="mb-4">

View File

@@ -9,7 +9,7 @@
# @since 0.1.0
#}
{% extends "base.html.twig" %}
{% extends "wc-base.html.twig" %}
{% block content %}
<article>

View File

@@ -1,7 +1,8 @@
{#
# Base Template (Bootstrap 5 Override)
#
# Overrides the plugin's base.html.twig with Bootstrap 5 components.
# WooCommerce base layout (renamed from base.html.twig to avoid
# shadowing the parent theme's full page shell).
# Provides the basic structure and block definitions.
#
# When _theme_wrapped is true, the parent theme already provides the page