Skip to content

Commit

Permalink
page section title component, added mising img-fluid class in categor…
Browse files Browse the repository at this point in the history
…y image(looks bad when it's not there)
  • Loading branch information
JBLach committed Dec 21, 2022
1 parent f0f69f4 commit aea197c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion templates/catalog/_partials/category-header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="js-product-list-header">
{if $listing.pagination.items_shown_from == 1}
<div class="block-category">
<h1 class="h1 mb-4">{$category.name}</h1>
{include file="components/page-title-section.tpl" title={$category.name}}
{if $category.description}
<div id="category-description" class="rich-text mb-4">{$category.description nofilter}</div>
{/if}
Expand All @@ -14,6 +14,7 @@
<img src="{$category.image.large.url}"
alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}"
loading="lazy"
class="img-fluid"
width="{$category.image.large.width}"
height="{$category.image.large.height}">
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/catalog/brands.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{block name='content'}
{block name='brand_header'}
<h1 class="h1 mb-4">{l s='Brands' d='Shop.Theme.Catalog'}</h1>
{include file="components/page-title-section.tpl" title={l s='Brands' d='Shop.Theme.Catalog'}}
{/block}

{block name='brand_miniature'}
Expand Down
2 changes: 1 addition & 1 deletion templates/catalog/listing/manufacturer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
<h1 class="h1 mb-4">{l s='List of products by brand %brand_name%' sprintf=['%brand_name%' => $manufacturer.name] d='Shop.Theme.Catalog'}</h1>
{include file="components/page-title-section.tpl" title={l s='List of products by brand %brand_name%' sprintf=['%brand_name%' => $manufacturer.name] d='Shop.Theme.Catalog'}}
<div id="manufacturer-short_description" class="rich-text">{$manufacturer.short_description nofilter}</div>
<div id="manufacturer-description" class="rich-text">{$manufacturer.description nofilter}</div>
{/block}
2 changes: 1 addition & 1 deletion templates/catalog/listing/supplier.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
<h1 class="h1 mb-4">{l s='List of products by supplier %s' sprintf=[$supplier.name] d='Shop.Theme.Catalog'}</h1>
{include file="components/page-title-section.tpl" title={l s='List of products by supplier %s' sprintf=[$supplier.name] d='Shop.Theme.Catalog'}}
<div id="supplier-description" class="rich-text">{$supplier.description nofilter}</div>
{/block}
2 changes: 1 addition & 1 deletion templates/catalog/suppliers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
{extends file='catalog/brands.tpl'}

{block name='brand_header'}
<h1 class="h1 mb-4">{l s='Suppliers' d='Shop.Theme.Catalog'}</h1>
{include file="components/page-title-section.tpl" title={l s='Suppliers' d='Shop.Theme.Catalog'}}
{/block}
9 changes: 9 additions & 0 deletions templates/components/page-title-section.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{$componentName = 'page-title-section'}

{block name='page_title_section'}
<h1 class="{$componentName} h1 mb-4">{$title}</h1>
{/block}

0 comments on commit aea197c

Please sign in to comment.