{% if products|length %} {% hook 'brands:single.items.start' %} - +
+ {% include 'pages.partials.product.skeleton' with { type: 'grid', count: 8 } %} + +
{% hook 'brands:single.items.end' %} {% else %}
diff --git a/src/views/pages/partials/product/skeleton.twig b/src/views/pages/partials/product/skeleton.twig new file mode 100644 index 000000000..accf6418d --- /dev/null +++ b/src/views/pages/partials/product/skeleton.twig @@ -0,0 +1,30 @@ +{# +| Variable | Type | Description | +|--------------|---------|--------------------------------------------------------------| +| type | string | slider, grid, filters (grid beside the filters) or horizontal | +| count | ?int | Number of placeholder cards, default 4 | +| title | ?bool | Reserve the slider title row | +| source | ?string | Products source, to skip sources that can never load | +| source_value | ?array | Products source value | +#} +{# these sources fetch nothing without a value, so there is nothing to wait for #} +{% set never_loads = source|default and source not in ['offers', 'latest', 'sales', 'top-rated'] and source_value is empty %} +{% if not never_loads %} + +{% endif %} diff --git a/src/views/pages/product/index.twig b/src/views/pages/product/index.twig index 81d140227..957ad849d 100644 --- a/src/views/pages/product/index.twig +++ b/src/views/pages/product/index.twig @@ -71,7 +71,8 @@ {% set has_selected_sort = sort_list|filter(sort => sort.is_selected)|length %} {% set fallback_sort = (sort_list|length and not has_selected_sort and first_sort.id != 'ourSuggest') ? first_sort.id : '' %} -
+
+ {% include 'pages.partials.product.skeleton' with { type: filters ? 'filters' : 'grid', count: 8 } %}