Skip to content

Commit

Permalink
[#80] Hero pattern (#119)
Browse files Browse the repository at this point in the history
* [#80] setting up the hero banner pattern files

* [#80] updating pattern layout changing name

* [#80] adding e to esc_attr
  • Loading branch information
nathan-schmidt-viget authored Jan 5, 2024
1 parent 64d8f16 commit 28afc40
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client-mu-plugins/goodbids/src/classes/Frontend/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,26 @@ function (): void {
'categories' => [ 'page', 'goodbids' ],
'keywords' => [ 'non-profit', 'auction' ],
'postTypes' => [ 'gb-auction', 'wp_template' ],
'source' => 'theme',
'source' => 'plugin',
'inserter' => false,
];

$hero_banner = [
'name' => 'goodbids-banner-hero',
'path' => GOODBIDS_PLUGIN_PATH . 'views/patterns/banner-hero.php',
'title' => __( 'Goodbids Banner Hero', 'goodbids' ),
'categories' => [ 'banner', 'featured', 'call-to-action', 'goodbids' ],
'keywords' => [ 'banner', 'call-to-action', 'featured', 'hero' ],
'source' => 'plugin',
'inserter' => true,
];

$this->patterns = apply_filters(
'goodbids_block_patterns',
[
$auction_archive,
$template_auction,
$hero_banner,
]
);

Expand Down
34 changes: 34 additions & 0 deletions client-mu-plugins/goodbids/views/patterns/banner-hero.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Pattern: GoodBids Hero
*
* @since 1.0.0
* @package GoodBids
*/

?>

<!-- wp:media-text {"align":"wide","mediaPosition":"right","mediaId":61,"mediaLink":"http://goodbids.vipdev.lndo.site/sample-page/e-commerce-logistics-_-present-gift-box-package-delivery-shipping-giveaway/","mediaType":"image","mediaSizeSlug":"full","verticalAlignment":"top","imageFill":false,"style":{"spacing":{"margin":{"bottom":"80px"},"padding":{"top":"0","bottom":"0"}}}} -->
<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-top" style="margin-bottom:80px;padding-top:0;padding-bottom:0">
<div class="wp-block-media-text__content">
<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading"><?php esc_html_e( 'Lorem ipsum dolor sit amet', 'goodbids' ); ?></h1>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>
<?php esc_html_e( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam', 'goodbids' ); ?>
</p>
<!-- /wp:paragraph -->

<!-- wp:buttons {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|40"}}}} -->
<div class="wp-block-buttons" style="margin-bottom:var(--wp--preset--spacing--40)">
<!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="#"><?php esc_html_e( 'Lorem Ipsum', 'goodbids' ); ?></a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<figure class="wp-block-media-text__media"><img src="" alt="<?php esc_attr_e( 'Short description of the image', 'goodbids' ); ?>" class="size-full" /></figure>
</div>
<!-- /wp:media-text -->

0 comments on commit 28afc40

Please sign in to comment.