Skip to content

Commit

Permalink
Work with blade
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebuchy committed Jan 26, 2019
1 parent 5499d00 commit ffe3a07
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 31 deletions.
20 changes: 20 additions & 0 deletions cache/blade/0a577f9e34358c4152a84a1ad017447a6fd0ca40.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<section class="g-py-100">

<div class="container">
<div class="row no-gutters">
<?php if ($block->columns): foreach ($block->columns as $column): ?>
<div class="col-lg-4 g-px-40 g-mb-50 g-mb-0--lg">
<!-- Icon Blocks -->
<div class="text-center">
<span class="d-inline-block u-icon-v3 u-icon-size--xl g-bg-primary g-color-white rounded-circle g-mb-30">
<i class="<?php echo e($column['icon']); ?> u-line-icon-pro"></i>
</span>
<h3 class="h5 g-color-gray-dark-v2 g-font-weight-600 text-uppercase mb-3"><?php echo e($column['title']); ?></h3>
<p class="mb-0"><?php echo $column['content']; ?></p>
</div>
<!-- End Icon Blocks -->
</div>
<?php endforeach; endif; ?>
</div>
</div>
</section>
25 changes: 25 additions & 0 deletions cache/blade/e4c265baa2b4cd074be983c1e98fd8b8d67cfc15.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<section class="g-pos-rel">
<div class="dzsparallaxer auto-init height-is-based-on-content use-loading mode-scroll loaded dzsprx-readyall" data-options="{direction: 'reverse', settings_mode_oneelement_max_offset: '150'}">
<div class="divimage dzsparallaxer--target w-100 g-bg-cover g-bg-pos-top-center g-bg-img-hero g-bg-bluegray-opacity-0_2--after" style="height: 130%; background-image: url(<?= $block->image['url']; ?>); transform: translate3d(0px, -60.1227px, 0px);"></div>

<div class="container g-bg-cover__inner g-py-100">
<div class="row align-items-center">
<div class="col-lg-6 g-mb-30 g-mb-0--lg">
<h2 class="h1 text-uppercase g-color-white g-mb-30">
<?= $block->heading; ?>
</h2>
<h3 class="h4 g-color-white">
<?= get_field('intro'); ?>
</h3>
</div>
<div class="col-lg-6">
<!-- Vimeo Example -->
<div class="embed-responsive embed-responsive-16by9">
<iframe src="<?= $block->video_url; ?>" width="530" height="300" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
</div>
<!-- End Vimeo Example -->
</div>
</div>
</div>
</div>
</section>
5 changes: 2 additions & 3 deletions lib/acf-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ function my_acf_block_render_callback($block)
// convert name ("acf/testimonial") into path friendly slug ("testimonial")
$slug = str_replace('acf/', '', $block['name']);

$block = '';
$array = call_user_func(['Gutenberg_Blocks\Classes\Config', $slug]);

if (is_array($array)) {
$class = 'Gutenberg_Blocks\\Classes\\Block';
$block = new $class($array, $slug);
}

if (file_exists(\Gutenberg_Blocks\_get_plugin_directory() . "/php-blocks/{$slug}/template.php")) {
include \Gutenberg_Blocks\_get_plugin_directory() . "/php-blocks/{$slug}/template.php";
if (file_exists(\Gutenberg_Blocks\_get_plugin_directory() . "/php-blocks/{$slug}/index.blade.php")) {
\render_blade_view("{$slug}.index", ['block' => $block]);
}
}
12 changes: 0 additions & 12 deletions php-blocks/hero/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
<?php
/**
* Block Name: Hero
*
* This is the template that displays the testimonial block.
*/
$array = call_user_func(['Gutenberg_Blocks\Classes\Config', $slug]);
$class = 'Gutenberg_Blocks\\Classes\\Block';
$block = new $class($array, 'hero-default');
?>

<section class="g-pos-rel">
<div class="dzsparallaxer auto-init height-is-based-on-content use-loading mode-scroll loaded dzsprx-readyall" data-options="{direction: 'reverse', settings_mode_oneelement_max_offset: '150'}">
<div class="divimage dzsparallaxer--target w-100 g-bg-cover g-bg-pos-top-center g-bg-img-hero g-bg-bluegray-opacity-0_2--after" style="height: 130%; background-image: url(<?= $block->image['url']; ?>); transform: translate3d(0px, -60.1227px, 0px);"></div>
Expand Down
19 changes: 3 additions & 16 deletions php-blocks/threecolumns/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
<?php
/**
* Block Name: Three Columns
*
* This is the template that displays the testimonial block.
*/
$array = call_user_func(['Gutenberg_Blocks\Classes\Config', 'threecolumns']);
$class = 'Gutenberg_Blocks\\Classes\\Block';
$block = new $class($array, 'threecolumns');
?>

<section class="g-py-100">

<div class="container">
<div class="row no-gutters">
<?php if ($block->columns): foreach ($block->columns as $column): ?>
<div class="col-lg-4 g-px-40 g-mb-50 g-mb-0--lg">
<!-- Icon Blocks -->
<div class="text-center">
<span class="d-inline-block u-icon-v3 u-icon-size--xl g-bg-primary g-color-white rounded-circle g-mb-30">
<i class="<?= $column['icon']; ?> u-line-icon-pro"></i>
<i class="{{ $column['icon'] }} u-line-icon-pro"></i>
</span>
<h3 class="h5 g-color-gray-dark-v2 g-font-weight-600 text-uppercase mb-3"><?= $column['title']; ?></h3>
<p class="mb-0"><?= $column['content']; ?></p>
<h3 class="h5 g-color-gray-dark-v2 g-font-weight-600 text-uppercase mb-3">{{ $column['title'] }}</h3>
<p class="mb-0">{!! $column['content'] !!}</p>
</div>
<!-- End Icon Blocks -->
</div>
Expand Down

0 comments on commit ffe3a07

Please sign in to comment.