2022-12-05 11:57:51 +00:00
< ? php
/**
2023-06-21 07:50:12 +00:00
* Title : Alternating Image and Text
2022-12-05 11:57:51 +00:00
* Slug : woocommerce - blocks / alt - image - and - text
* Categories : WooCommerce
*/
2023-09-19 07:05:44 +00:00
2023-09-25 09:48:52 +00:00
use Automattic\WooCommerce\Blocks\Patterns\PatternsHelper ;
2023-09-19 07:05:44 +00:00
2023-11-20 13:43:27 +00:00
$image1 = PatternsHelper :: get_image_url ( $images , 0 , 'images/pattern-placeholders/tea-leaf-meal-food-herb-produce.jpg' );
$image2 = PatternsHelper :: get_image_url ( $images , 1 , 'images/pattern-placeholders/drinkware-liquid-tableware-dishware-bottle-fluid.jpg' );
2023-10-13 08:08:35 +00:00
$first_title = $content [ 'titles' ][ 0 ][ 'default' ] ? ? '' ;
$second_title = $content [ 'titles' ][ 1 ][ 'default' ] ? ? '' ;
$third_title = $content [ 'titles' ][ 2 ][ 'default' ] ? ? '' ;
$fourth_title = $content [ 'titles' ][ 3 ][ 'default' ] ? ? '' ;
$fifth_title = $content [ 'titles' ][ 4 ][ 'default' ] ? ? '' ;
$first_description = $content [ 'descriptions' ][ 0 ][ 'default' ] ? ? '' ;
$second_description = $content [ 'descriptions' ][ 1 ][ 'default' ] ? ? '' ;
2023-12-01 09:49:17 +00:00
$list1 = $content [ 'descriptions' ][ 2 ][ 'default' ] ? ? '' ;
$list2 = $content [ 'descriptions' ][ 3 ][ 'default' ] ? ? '' ;
$list3 = $content [ 'descriptions' ][ 4 ][ 'default' ] ? ? '' ;
$list4 = $content [ 'descriptions' ][ 5 ][ 'default' ] ? ? '' ;
2023-10-13 08:08:35 +00:00
$button = $content [ 'buttons' ][ 0 ][ 'default' ] ? ? '' ;
2022-12-05 11:57:51 +00:00
?>
2023-09-19 07:05:44 +00:00
2023-07-25 08:12:29 +00:00
<!-- wp : group { " align " : " wide " } -->
2023-08-11 07:33:54 +00:00
< div class = " wp-block-group alignwide " >
<!-- wp : columns { " align " : " wide " } -->
< div class = " wp-block-columns alignwide " >
<!-- wp : column { " verticalAlignment " : " center " , " width " : " 50% " } -->
< div class = " wp-block-column is-vertically-aligned-center " style = " flex-basis:50% " >
<!-- wp : image { " sizeSlug " : " full " , " linkDestination " : " none " } -->
< figure class = " wp-block-image size-full " >
2023-09-19 07:05:44 +00:00
< img src = " <?php echo esc_url( $image1 ); ?> " alt = " <?php esc_attr_e( 'Placeholder image used in the left column.', 'woo-gutenberg-products-block' ); ?> " />
2023-08-11 07:33:54 +00:00
</ figure >
<!-- / wp : image -->
</ div >
<!-- / wp : column -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : column { " verticalAlignment " : " center " , " width " : " 50% " } -->
< div class = " wp-block-column is-vertically-aligned-center " style = " flex-basis:50% " >
<!-- wp : paragraph { " placeholder " : " Content… " , " style " : { " typography " : { " textTransform " : " uppercase " }}} -->
2023-12-01 09:49:17 +00:00
< p style = " text-transform:uppercase " >< ? php echo esc_html ( $first_title ); ?> </p>
2023-08-11 07:33:54 +00:00
<!-- / wp : paragraph -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : heading { " level " : 3 , " style " : { " spacing " : { " margin " : { " top " : " 0 " , " bottom " : " 0 " }}}} -->
2023-10-13 08:08:35 +00:00
< h3 class = " wp-block-heading " style = " margin-top:0;margin-bottom:0 " >< ? php echo esc_html ( $second_title ); ?> </h3>
2023-08-11 07:33:54 +00:00
<!-- / wp : heading -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : paragraph -->
2023-10-13 08:08:35 +00:00
< p >< ? php echo esc_html ( $first_description ); ?> </p>
2023-08-11 07:33:54 +00:00
<!-- / wp : paragraph -->
2023-12-01 09:49:17 +00:00
<!-- wp : list -->
< ul >
<!-- wp : list - item -->
< li >< ? php echo esc_html ( $list1 ); ?> </li>
<!-- / wp : list - item -->
<!-- wp : list - item -->
< li >< ? php echo esc_html ( $list2 ); ?> </li>
<!-- / wp : list - item -->
<!-- wp : list - item -->
< li >< ? php echo esc_html ( $list3 ); ?> </li>
<!-- / wp : list - item -->
<!-- wp : list - item -->
< li >< ? php echo esc_html ( $list4 ); ?> </li>
<!-- / wp : list - item -->
</ ul >
<!-- / wp : list -->
2023-08-11 07:33:54 +00:00
</ div >
<!-- / wp : column -->
</ div >
<!-- / wp : columns -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : columns { " align " : " wide " } -->
< div class = " wp-block-columns alignwide " >
<!-- wp : column { " verticalAlignment " : " center " , " width " : " 48% " } -->
< div class = " wp-block-column is-vertically-aligned-center " style = " flex-basis:48% " >
<!-- wp : paragraph { " placeholder " : " Content… " , " style " : { " typography " : { " textTransform " : " uppercase " }}} -->
2023-10-13 08:08:35 +00:00
< p style = " text-transform:uppercase " >< ? php echo esc_html ( $third_title ); ?> </p>
2023-08-11 07:33:54 +00:00
<!-- / wp : paragraph -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : heading { " level " : 3 , " style " : { " spacing " : { " margin " : { " top " : " 0 " , " bottom " : " 0 " }}}} -->
2023-10-13 08:08:35 +00:00
< h3 class = " wp-block-heading " style = " margin-top:0;margin-bottom:0 " >< ? php echo esc_html ( $fourth_title ); ?> </h3>
2023-08-11 07:33:54 +00:00
<!-- / wp : heading -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : paragraph -->
2023-10-13 08:08:35 +00:00
< p >< ? php echo esc_html ( $second_description ); ?> </p>
2023-08-11 07:33:54 +00:00
<!-- / wp : paragraph -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : buttons { " style " : { " spacing " : { " blockGap " : " 0 " }}, " fontSize " : " small " } -->
< div class = " wp-block-buttons has-custom-font-size has-small-font-size " >
2023-12-01 09:49:17 +00:00
<!-- wp : button { " className " : " is-style-fill " } -->
< div class = " wp-block-button is-style-fill " >
2023-10-13 08:08:35 +00:00
< a class = " wp-block-button__link wp-element-button " >< ? php echo esc_html ( $button ); ?> </a>
2023-08-11 07:33:54 +00:00
</ div >
<!-- / wp : button -->
</ div >
<!-- / wp : buttons -->
</ div >
<!-- / wp : column -->
2022-12-05 11:57:51 +00:00
2023-08-11 07:33:54 +00:00
<!-- wp : column { " verticalAlignment " : " center " , " width " : " 52% " } -->
< div class = " wp-block-column is-vertically-aligned-center " style = " flex-basis:52% " >
2023-11-20 13:43:27 +00:00
<!-- wp : image { " sizeSlug " : " full " , " linkDestination " : " none " , " height " : " auto " , " aspectRatio " : " 1 " , " scale " : " cover " , " className " : " is-resized " } -->
< figure class = " wp-block-image size-full is-resized " >
< img style = " aspect-ratio:1;object-fit:cover " src = " <?php echo esc_url( $image2 ); ?> " alt = " <?php esc_attr_e( 'Placeholder image used in the right column.', 'woo-gutenberg-products-block' ); ?> " />
2023-08-11 07:33:54 +00:00
</ figure >
<!-- / wp : image -->
</ div >
<!-- / wp : column -->
</ div >
<!-- / wp : columns -->
</ div >
2022-12-05 11:57:51 +00:00
<!-- / wp : group -->