Store Customization > Ensure the Just Arrived Full Hero pattern can have an AI selected image assigned to it (https://github.com/woocommerce/woocommerce-blocks/pull/11159)

* Add titles to patterns and set the aligment to Wide

* Replace product query patterns with product collection ones

* Add group and spacing to the 3-cols and social patterns

* Fix alignment issue in the testimonals 3 in the editor

* Add padding to the featured catergory triple pattern

* Remove pagination and no results query from product query patterns

* Add aspect ratio to the product image attributes

* Add portrait aspect ratio to product X column and product gallery patterns

* Fix PHP warning and remove the padding for the Testimonials 3 Columns pattern.

* Ensure the Just Arrived Full Hero pattern can have an AI managed image assigned to it and update the content assignment.

* Add background dim

* Update dim to 30

* Update text for the main header.

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
This commit is contained in:
Patricia Hillebrandt 2023-10-06 13:17:31 +02:00 committed by GitHub
parent 15d24a227f
commit 75c48ffb47
2 changed files with 13 additions and 9 deletions

View File

@ -9,29 +9,31 @@ use Automattic\WooCommerce\Blocks\Patterns\PatternsHelper;
$content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/just-arrived-full-hero' );
$images = PatternsHelper::get_pattern_images( 'woocommerce-blocks/just-arrived-full-hero' );
$image1 = PatternsHelper::get_image_url( $images, 0, 'images/pattern-placeholders/plant-in-vase.jpg' );
$pattern_title = $content['titles'][0]['default'] ?? '';
$pattern_description = $content['descriptions'][0]['default'] ?? '';
$pattern_button = $content['buttons'][0]['default'] ?? '';
$pattern_image = PatternsHelper::get_image_url( $images, 0, 'images/pattern-placeholders/plant-in-vase.jpg' );
?>
<!-- wp:cover {"url":"<?php echo esc_url( $image1 ); ?>","dimRatio":0,"minHeight":739,"contentPosition":"center right","isDark":false,"align":"wide","style":{"spacing":{"padding":{"right":"4em"}}}} -->
<div class="wp-block-cover alignwide is-light has-custom-content-position is-position-center-right" style="padding-right:4em;min-height:739px">
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span>
<img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $image1 ); ?>" data-object-fit="cover"/>
<!-- wp:cover {"url":"<?php echo esc_url( $pattern_image ); ?>","dimRatio":30,"minHeight":739,"contentPosition":"center right","align":"wide","style":{"spacing":{"padding":{"right":"4em"}}}} -->
<div class="wp-block-cover alignwide has-custom-content-position is-position-center-right" style="padding-right:4em;min-height:739px">
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $pattern_image ); ?>" data-object-fit="cover"/>
<div class="wp-block-cover__inner-container">
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading {"anchor":"just-arrived"} -->
<h2 class="wp-block-heading" id="just-arrived"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h2>
<h2 class="wp-block-heading" id="just-arrived"><?php echo esc_html( $pattern_title ); ?></h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p><?php echo esc_html( $content['descriptions'][0]['default'] ); ?></p>
<p><?php echo esc_html( $pattern_description ); ?></p>
<!-- /wp:paragraph -->
<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button -->
<div class="wp-block-button">
<a class="wp-block-button__link wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html( $content['buttons'][0]['default'] ); ?></a>
<a class="wp-block-button__link wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html( $pattern_button ); ?></a>
</div>
<!-- /wp:button -->
</div>

View File

@ -256,6 +256,8 @@
{
"name": "Just Arrived Full Hero",
"slug": "woocommerce-blocks/just-arrived-full-hero",
"images_total": 1,
"images_format": "landscape",
"content": {
"titles": [
{