Files
wc-bootstrap/templates/layouts/single.html.twig
magdev c3b16b68c5 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>
2026-02-28 12:29:20 +01:00

54 lines
1.6 KiB
Twig

{#
# Single Post Layout (Bootstrap 5 Override)
#
# Layout for single detail pages.
# Supports an optional sidebar via the article_sidebar block.
# When no sidebar content is provided, content spans full width.
#
# @package WcBootstrap
# @since 0.1.0
#}
{% extends "wc-base.html.twig" %}
{% block content %}
<article>
{% block article_header %}
<header class="d-flex flex-wrap align-items-start gap-3 mb-4">
{% if has_thumbnail %}
<div class="flex-shrink-0">
<img src="{{ thumbnail }}" alt="{{ title|esc_attr }}" class="rounded img-fluid" style="max-width: 150px;">
</div>
{% endif %}
<div class="flex-grow-1">
<h1>{{ title|esc_html }}</h1>
{% block article_meta %}{% endblock %}
</div>
{% block article_actions %}{% endblock %}
</header>
{% endblock %}
<div class="row g-4">
<div class="{% block content_col_class %}col-lg-8{% endblock %}">
{% block article_content %}
<div>
{{ original_content|default('')|wp_kses_post }}
</div>
{% endblock %}
</div>
{% set _sidebar_html %}{% block article_sidebar %}{% endblock %}{% endset %}
{% if _sidebar_html|trim %}
<aside class="col-lg-4">
{{ _sidebar_html|raw }}
</aside>
{% endif %}
</div>
{% block article_footer %}{% endblock %}
</article>
{% endblock %}