Last active
July 29, 2016 19:45
-
-
Save stevep/f3d2aa263a189a5b2560c138f63b9ef0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace StoutLogic\YoungDental\Fields; | |
class BrandSlide extends \Understory\ACF\FieldGroup | |
{ | |
protected function configure($builder) | |
{ | |
return $builder | |
->addText('title') | |
->addWysiwyg('quote') | |
->addText('citation'); | |
} | |
public function getQuote() | |
{ | |
return apply_filters('the_content', $this->getMetaValue('quote')); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace StoutLogic\YoungDental\Fields; | |
class BrandSlider extends \Understory\ACF\FieldGroup | |
{ | |
protected function configure($builder) | |
{ | |
return $builder | |
->addRepeater('slides', ['layout' => 'block']) | |
->addFields(new BrandSlide); | |
} | |
public function getSlides() | |
{ | |
return $this->getMetaValues('slides', BrandSlide::class); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Home | |
*/ | |
namespace StoutLogic\YoungDental\Views; | |
use StoutLogic\YoungDental\Fields; | |
class HomeTemplate extends \Understory\View | |
{ | |
protected function configure() | |
{ | |
$this->set('brandSlider', new Fields\BrandSlider); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.twig" %} | |
{%- block content -%} | |
{% for slide in brandSlider.slides %} | |
<h2>{{ slide.title }}</h2> | |
<blockquote> | |
{{ slide.quote }} | |
<cite>{{ slide.citation }}</cite> | |
</blockquote> | |
{% endfor %} | |
{%- endblock -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment