FEATURE: add shortcodes into binarity template
This commit is contained in:
@@ -3,6 +3,7 @@ namespace App\CMS\Pipeline\DisplayPipeline\Process;
|
||||
|
||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||
use App\Models\Content\Content;
|
||||
use Webwizo\Shortcodes\Facades\Shortcode;
|
||||
|
||||
class CompileShortcodes implements Process {
|
||||
/**
|
||||
@@ -14,6 +15,6 @@ class CompileShortcodes implements Process {
|
||||
*/
|
||||
function handle(Content & $page)
|
||||
{
|
||||
// TODO: Implement handle() method.
|
||||
$page->pageContent = Shortcode::compile($page->pageContent);
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,7 @@ use App\Models\Content\Content;
|
||||
use App\Models\Module;
|
||||
use App\Models\User;
|
||||
use App\Models\Widgets\WidgetArea;
|
||||
use Templates\Binarity\Shortcodes\DarkBlock;
|
||||
use Templates\Binarity\Shortcodes\TechnologiesWrapper;
|
||||
use Templates\Binarity\Shortcodes\Technology;
|
||||
use Webwizo\Shortcodes\Facades\Shortcode;
|
||||
|
||||
|
||||
class Handler implements TemplateHandler
|
||||
{
|
||||
@@ -85,37 +82,4 @@ class Handler implements TemplateHandler
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare Content object to be rendered using Blade template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforeRender(Content & $content)
|
||||
{
|
||||
Shortcode::register('technologies', TechnologiesWrapper::class);
|
||||
Shortcode::register('tech', Technology::class);
|
||||
Shortcode::register('dark', DarkBlock::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify input data into format which can be understood by edit template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforePopulatingEditForm(Content & $content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Slightly modify Content object before saving into database.
|
||||
*
|
||||
* This way we can do almost whatever we want - even in template
|
||||
*
|
||||
* @param Content $content
|
||||
* @param $request
|
||||
*/
|
||||
public static function beforeSave(Content & $content, $inputData)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Templates\Binarity\Providers;
|
||||
|
||||
use Templates\Binarity\Shortcodes\DarkBlock;
|
||||
use Templates\Binarity\Shortcodes\TechnologiesWrapper;
|
||||
use Templates\Binarity\Shortcodes\Technology;
|
||||
use Webwizo\Shortcodes\Facades\Shortcode;
|
||||
|
||||
class ServiceProvider extends \Illuminate\Support\ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
Shortcode::register('technologies', TechnologiesWrapper::class);
|
||||
Shortcode::register('tech', Technology::class);
|
||||
Shortcode::register('dark', DarkBlock::class);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@
|
||||
.cz</a></li>
|
||||
<li class="phone-li"><a href="tel:00420775323455">+420 775 323 455</a></li>
|
||||
<li><br></li>
|
||||
<li>© 2016 binarity s.r.o.</li>
|
||||
<li>© {date('Y') binarity s.r.o.</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</footer>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
return [
|
||||
'providers' => [],
|
||||
'providers' => [\Templates\Binarity\Providers\BinarityServiceProvider::class],
|
||||
'files' => [],
|
||||
'handler' => \Templates\Binarity\Handler::class,
|
||||
'name' => 'binarity s.r.o.',
|
||||
|
||||
Reference in New Issue
Block a user