Store Customization > Homepage Template 3: Review layout and spacing in between patterns (https://github.com/woocommerce/woocommerce-blocks/pull/11131)
* Add padding and headers to patterns * Fix centering when GB enabled
This commit is contained in:
parent
4716d7483e
commit
592db8df43
|
@ -23,8 +23,8 @@ $image3 = PatternsHelper::get_image_url( $images, 2, 'images/pattern-placeholder
|
|||
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span>
|
||||
<img class="wp-block-cover__image-background wp-image-1" alt="<?php esc_attr_e( 'Placeholder image used to represent products being showcased in featured categories banner. 1 out of 3.', 'woo-gutenberg-products-block' ); ?>" src="<?php echo esc_url( $image1 ); ?>" data-object-fit="cover"/>
|
||||
<div class="wp-block-cover__inner-container">
|
||||
<!-- wp:heading {"level":4} -->
|
||||
<h4 class="wp-block-heading"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h4>
|
||||
<!-- wp:heading {"textAlign":"center","level":4} -->
|
||||
<h4 class="wp-block-heading has-text-align-center"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h4>
|
||||
<!-- /wp:heading -->
|
||||
<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"spacing":{"padding":{"top":"0","bottom":"0"},"margin":{"top":"0","bottom":"0"}}}} -->
|
||||
<p class="has-text-align-center has-link-color" style="margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0">
|
||||
|
@ -44,8 +44,8 @@ $image3 = PatternsHelper::get_image_url( $images, 2, 'images/pattern-placeholder
|
|||
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span>
|
||||
<img class="wp-block-cover__image-background wp-image-1" alt="<?php esc_attr_e( 'Placeholder image used to represent products being showcased in featured categories banner. 2 out of 3.', 'woo-gutenberg-products-block' ); ?>" src="<?php echo esc_url( $image2 ); ?>" data-object-fit="cover"/>
|
||||
<div class="wp-block-cover__inner-container">
|
||||
<!-- wp:heading {"level":4} -->
|
||||
<h4 class="wp-block-heading"><?php echo esc_html( $content['titles'][1]['default'] ); ?></h4>
|
||||
<!-- wp:heading {"textAlign":"center","level":4} -->
|
||||
<h4 class="wp-block-heading has-text-align-center "><?php echo esc_html( $content['titles'][1]['default'] ); ?></h4>
|
||||
<!-- /wp:heading -->
|
||||
<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"spacing":{"padding":{"top":"0","bottom":"0"},"margin":{"top":"0","bottom":"0"}}}} -->
|
||||
<p class="has-text-align-center has-link-color" style="margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0">
|
||||
|
@ -65,8 +65,8 @@ $image3 = PatternsHelper::get_image_url( $images, 2, 'images/pattern-placeholder
|
|||
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span>
|
||||
<img class="wp-block-cover__image-background wp-image-1" alt="<?php esc_attr_e( 'Placeholder image used to represent products being showcased in featured categories banner. 3 out of 3', 'woo-gutenberg-products-block' ); ?>" src="<?php echo esc_url( $image3 ); ?>" data-object-fit="cover"/>
|
||||
<div class="wp-block-cover__inner-container">
|
||||
<!-- wp:heading {"level":4} -->
|
||||
<h4 class="wp-block-heading"><?php echo esc_html( $content['titles'][2]['default'] ); ?></h4>
|
||||
<!-- wp:heading {"textAlign":"center","level":4} -->
|
||||
<h4 class="wp-block-heading has-text-align-center"><?php echo esc_html( $content['titles'][2]['default'] ); ?></h4>
|
||||
<!-- /wp:heading -->
|
||||
<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"spacing":{"padding":{"top":"0","bottom":"0"},"margin":{"top":"0","bottom":"0"}}}} -->
|
||||
<p class="has-text-align-center has-link-color" style="margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0">
|
||||
|
|
|
@ -8,9 +8,15 @@
|
|||
use Automattic\WooCommerce\Blocks\Patterns\PatternsHelper;
|
||||
$content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/product-collection-featured-products-5-columns' );
|
||||
?>
|
||||
<!-- wp:heading {"textAlign":"center","level":3,"align":"wide"} -->
|
||||
<h3 class="wp-block-heading alignwide has-text-align-center"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h3>
|
||||
<!-- /wp:heading -->
|
||||
|
||||
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
|
||||
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)">
|
||||
|
||||
<!-- wp:heading {"textAlign":"center","level":3} -->
|
||||
<h3 class="wp-block-heading has-text-align-center">
|
||||
<?php echo esc_html( $content['titles'][0]['default'] ); ?>
|
||||
</h3>
|
||||
<!-- /wp:heading -->
|
||||
|
||||
<!-- wp:woocommerce/product-collection {"query":{"perPage":5,"pages":0,"offset":0,"postType":"product","order":"asc","orderBy":"title","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":{},"parents":[],"isProductCollectionBlock":true,"woocommerceOnSale":false,"woocommerceStockStatus":["instock","outofstock","onbackorder"],"woocommerceAttributes":[],"woocommerceHandPickedProducts":[]},"tagName":"div","displayLayout":{"type":"flex","columns":5},"align":"wide"} -->
|
||||
<div class="wp-block-woocommerce-product-collection alignwide">
|
||||
|
@ -29,14 +35,16 @@ $content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/product-coll
|
|||
<!-- /wp:query-no-results --></div>
|
||||
<!-- /wp:woocommerce/product-collection -->
|
||||
|
||||
<!-- wp:buttons {"align":"wide","layout":{"type":"flex","verticalAlignment":"center","justifyContent":"center"}} -->
|
||||
<div class="wp-block-buttons alignwide">
|
||||
<!-- wp:button {"textAlign":"center"} -->
|
||||
<div class="wp-block-button">
|
||||
<a class="wp-block-button__link has-text-align-center wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Shop All', 'woo-gutenberg-products-block' ); ?>
|
||||
</a>
|
||||
<!-- wp:buttons {"align":"wide","layout":{"type":"flex","verticalAlignment":"center","justifyContent":"center"}} -->
|
||||
<div class="wp-block-buttons alignwide">
|
||||
<!-- wp:button {"textAlign":"center"} -->
|
||||
<div class="wp-block-button">
|
||||
<a class="wp-block-button__link has-text-align-center wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Shop All', 'woo-gutenberg-products-block' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- /wp:button -->
|
||||
</div>
|
||||
<!-- /wp:button -->
|
||||
<!-- /wp:buttons -->
|
||||
</div>
|
||||
<!-- /wp:buttons -->
|
||||
<!-- /wp:group -->
|
||||
|
|
|
@ -5,31 +5,45 @@
|
|||
* Categories: WooCommerce
|
||||
* Block Types: core/query/woocommerce/product-query
|
||||
*/
|
||||
use Automattic\WooCommerce\Blocks\Patterns\PatternsHelper;
|
||||
|
||||
$content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/product-query-product-gallery' );
|
||||
?>
|
||||
<!-- wp:query {"query":{"perPage":"6","pages":0,"offset":0,"postType":"product","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"__woocommerceAttributes":[],"__woocommerceStockStatus":["instock","outofstock","onbackorder"]},"displayLayout":{"type":"flex","columns":3},"namespace":"woocommerce/product-query"} -->
|
||||
<div class="wp-block-query"><!-- wp:post-template -->
|
||||
<!-- wp:woocommerce/product-image {"saleBadgeAlign":"left","isDescendentOfQueryLoop":true,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}}} /-->
|
||||
|
||||
<!-- wp:woocommerce/product-rating {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"0.75rem"}}}} /-->
|
||||
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}}},"layout":{"type":"constrained"}} -->
|
||||
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)">
|
||||
<!-- wp:heading {"level":3,"align":"wide"} -->
|
||||
<h3 class="wp-block-heading alignwide"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h3>
|
||||
<!-- /wp:heading -->
|
||||
|
||||
<!-- wp:post-title {"textAlign":"center","level":3,"isLink":true,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}},"fontSize":"medium","__woocommerceNamespace":"woocommerce/product-query/product-title"} /-->
|
||||
<!-- wp:query {"query":{"perPage":"6","pages":0,"offset":0,"postType":"product","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"__woocommerceAttributes":[],"__woocommerceStockStatus":["instock","outofstock","onbackorder"]},"displayLayout":{"type":"flex","columns":3},"namespace":"woocommerce/product-query","align":"wide"} -->
|
||||
<div class="wp-block-query alignwide">
|
||||
<!-- wp:post-template -->
|
||||
<!-- wp:woocommerce/product-image {"saleBadgeAlign":"left","isDescendentOfQueryLoop":true,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}}} /-->
|
||||
|
||||
<!-- wp:post-excerpt {"textAlign":"center","showMoreOnNewLine":false,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}},"fontSize":"small","__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
|
||||
<!-- wp:woocommerce/product-rating {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"0.75rem"}}}} /-->
|
||||
|
||||
<!-- wp:woocommerce/product-price {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"0.75rem"}}}} /-->
|
||||
<!-- /wp:post-template -->
|
||||
<!-- wp:post-title {"textAlign":"center","level":3,"isLink":true,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}},"fontSize":"medium","__woocommerceNamespace":"woocommerce/product-query/product-title"} /-->
|
||||
|
||||
<!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"center"}} -->
|
||||
<!-- wp:query-pagination-previous /-->
|
||||
<!-- wp:post-excerpt {"textAlign":"center","showMoreOnNewLine":false,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}},"fontSize":"small","__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
|
||||
|
||||
<!-- wp:query-pagination-numbers /-->
|
||||
<!-- wp:woocommerce/product-price {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"0.75rem"}}}} /-->
|
||||
<!-- /wp:post-template -->
|
||||
|
||||
<!-- wp:query-pagination-next /-->
|
||||
<!-- /wp:query-pagination -->
|
||||
<!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"center"}} -->
|
||||
<!-- wp:query-pagination-previous /-->
|
||||
|
||||
<!-- wp:query-no-results -->
|
||||
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
|
||||
<p></p>
|
||||
<!-- /wp:paragraph -->
|
||||
<!-- /wp:query-no-results --></div>
|
||||
<!-- /wp:query -->
|
||||
<!-- wp:query-pagination-numbers /-->
|
||||
|
||||
<!-- wp:query-pagination-next /-->
|
||||
<!-- /wp:query-pagination -->
|
||||
|
||||
<!-- wp:query-no-results -->
|
||||
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
|
||||
<p></p>
|
||||
<!-- /wp:paragraph -->
|
||||
<!-- /wp:query-no-results -->
|
||||
</div>
|
||||
<!-- /wp:query -->
|
||||
</div>
|
||||
<!-- /wp:group -->
|
||||
|
|
|
@ -355,6 +355,18 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Product Gallery",
|
||||
"slug": "woocommerce-blocks/product-query-product-gallery",
|
||||
"content": {
|
||||
"titles": [
|
||||
{
|
||||
"default": "Our newest arrivals",
|
||||
"ai_prompt": "An impact phrase that advertises the displayed product collection"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Product Collection 4 Columns",
|
||||
"slug": "woocommerce-blocks/product-collection-4-columns",
|
||||
|
|
Loading…
Reference in New Issue