remove sage 10
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
@extends('layouts.block', [
|
||||
'block' => $block,
|
||||
'data' => $data,
|
||||
])
|
||||
|
||||
@section('block-content')
|
||||
@if(@$data['wysiwyg'])
|
||||
<div class="main-wysiwyg wysiwyg">
|
||||
{!! @$data['wysiwyg'] !!}
|
||||
</div>
|
||||
@endif
|
||||
@overwrite
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB |
@@ -1,4 +0,0 @@
|
||||
export default function WYSIWYG()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Blocks\WYSIWYG;
|
||||
use App\Utilities;
|
||||
use App\ACF;
|
||||
|
||||
class WYSIWYG
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
add_action('acf/init', [$this, 'init']);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
acf_register_block_type([
|
||||
'name' => 'badegg/wysiwyg',
|
||||
'title' => __('Basic Content'),
|
||||
'description' => __('Basic text editor '),
|
||||
'render_callback' => [ $this, 'render'],
|
||||
'category' => 'badegg',
|
||||
'icon' => 'editor-paragraph',
|
||||
'supports' => [
|
||||
'align' => false,
|
||||
],
|
||||
'example' => [
|
||||
'attributes' => [
|
||||
'mode' => 'preview',
|
||||
'data' => [
|
||||
'inserter' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function render($block, $content = '', $is_preview = false)
|
||||
{
|
||||
$name = basename(__FILE__, '.php');
|
||||
$themeURL = get_template_directory_uri();
|
||||
|
||||
if($is_preview && @$block['data']['inserter']):
|
||||
echo '<img style="display: block; width: 100%" src="' . $themeURL . '/resources/views/blocks/' . $name . '/' . $name . '.jpg" />';
|
||||
return;
|
||||
endif;
|
||||
|
||||
$CssClasses = new Utilities\CssClasses;
|
||||
$Colour = new Utilities\Colour;
|
||||
$CloneGroup = new ACF\CloneGroup;
|
||||
|
||||
$data = [];
|
||||
|
||||
$fields = [
|
||||
'wysiwyg',
|
||||
];
|
||||
$fields = array_merge($fields, $CloneGroup->block_all());
|
||||
|
||||
foreach($fields as $field):
|
||||
$data[$field] = get_field($field);
|
||||
endforeach;
|
||||
|
||||
unset($block['data']);
|
||||
$block['name'] = str_replace('acf/', '', $block['name']);
|
||||
|
||||
$data = array_merge($data, $block);
|
||||
$data['section_classes'] = $CssClasses->section($data);
|
||||
$data['block'] = $block;
|
||||
|
||||
echo \Roots\view("blocks.$name.$name", [
|
||||
'data' => $data,
|
||||
'block' => $block,
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
.section-badegg-wysiwyg {
|
||||
container-name: WYSIWYG;
|
||||
container-type: inline-size;
|
||||
|
||||
.main-wysiwyg {
|
||||
@container WYSIWYG (min-width: #{$screen-lg}) {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
}
|
||||
|
||||
.section-intro { padding-bottom: $sectionSmall; }
|
||||
.section-footer { padding-top: $sectionSmall; }
|
||||
}
|
||||
Reference in New Issue
Block a user