Files
wc-bootstrap/templates/global/sidebar.html.twig

41 lines
1.3 KiB
Twig
Raw Normal View History

{#
# Shop Sidebar (Bootstrap 5 Override)
#
# Renders the WooCommerce shop sidebar using Bootstrap 5 offcanvas for mobile
# and a standard aside column for desktop.
#
# Expected context:
# sidebar_content - Pre-rendered sidebar widget HTML (from get_sidebar('shop'))
#
# WooCommerce PHP equivalent: global/sidebar.php
#
# @package WcBootstrap
# @since 0.1.0
#}
{% if sidebar_content is defined and sidebar_content %}
{# Mobile: offcanvas trigger button (visible below lg breakpoint) #}
<button class="btn btn-outline-secondary d-lg-none mb-3"
type="button"
data-bs-toggle="offcanvas"
data-bs-target="#shopSidebar"
aria-controls="shopSidebar">
<i class="bi bi-funnel" aria-hidden="true"></i>
{{ __('Filters') }}
</button>
{# Mobile: offcanvas panel #}
<div class="offcanvas offcanvas-start offcanvas-lg"
tabindex="-1"
id="shopSidebar"
aria-labelledby="shopSidebarLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="shopSidebarLabel">{{ __('Filters') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ __('Close') }}"></button>
</div>
<div class="offcanvas-body">
{{ sidebar_content|raw }}
</div>
</div>
{% endif %}