Commit 00488989 authored by Tino Goratsch's avatar Tino Goratsch

inject the seo form fields via the new template event "seo.layout.render_form_fields"

parent 6e6d46f7
......@@ -18,7 +18,7 @@
{include file="asset:Menus/Partials/create_menu_item.tpl"}
{/if}
</div>
{include file="asset:Seo/Partials/tab_seo_fields.tpl" seo=$SEO_FORM_FIELDS}
{event name="seo.layout.render_form_fields" SEO_FORM_FIELDS=$SEO_FORM_FIELDS}
</div>
</div>
{include file="asset:System/Partials/form_group.submit.tpl" form_token=$form_token back_url={uri args="acp/articles"}}
......
......@@ -54,7 +54,7 @@
{include file="asset:System/Partials/form_group.checkbox.tpl" options=$options label={lang t="system|options"}}
{/if}
</div>
{include file="asset:Seo/Partials/tab_seo_fields.tpl" seo=$SEO_FORM_FIELDS}
{event name="seo.layout.render_form_fields" SEO_FORM_FIELDS=$SEO_FORM_FIELDS}
</div>
</div>
{include file="asset:System/Partials/form_group.submit.tpl" form_token=$form_token back_url={uri args="acp/files"}}
......
......@@ -10,7 +10,7 @@
{datepicker name=['start', 'end'] value=[$form.start, $form.end]}
{include file="asset:System/Partials/form_group.input_text.tpl" name="title" value=$form.title required=true maxlength=120 data_attributes=['seo-slug-base' => 'true'] label={lang t="gallery|title"}}
</div>
{include file="asset:Seo/Partials/tab_seo_fields.tpl" seo=$SEO_FORM_FIELDS}
{event name="seo.layout.render_form_fields" SEO_FORM_FIELDS=$SEO_FORM_FIELDS}
</div>
</div>
{include file="asset:System/Partials/form_group.submit.tpl" form_token=$form_token back_url={uri args="acp/gallery"}}
......
......@@ -30,7 +30,7 @@
{include file="asset:System/Partials/form_group.input_url.tpl" name="uri" value=$form.uri maxlength=120 label={lang t="news|uri"}}
{include file="asset:System/Partials/form_group.select.tpl" options=$target label={lang t="news|target_page"}}
</div>
{include file="asset:Seo/Partials/tab_seo_fields.tpl" seo=$SEO_FORM_FIELDS}
{event name="seo.layout.render_form_fields" SEO_FORM_FIELDS=$SEO_FORM_FIELDS}
</div>
</div>
{include file="asset:System/Partials/form_group.submit.tpl" form_token=$form_token back_url={uri args="acp/news"}}
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Seo\Event\Listener;
use ACP3\Core\View;
use ACP3\Core\View\Event\TemplateEvent;
class OnLayoutSeoRenderFormFieldsListener
{
/**
* @var View
*/
private $view;
/**
* OnLayoutSeoFormFieldsListener constructor.
* @param View $view
*/
public function __construct(View $view)
{
$this->view = $view;
}
/**
* @param TemplateEvent $event
*/
public function renderSeoFormFields(TemplateEvent $event)
{
$parameters = $event->getParameters();
$this->view->assign('seo', isset($parameters['SEO_FORM_FIELDS']) ? $parameters['SEO_FORM_FIELDS'] : []);
$this->view->displayTemplate('Seo/Partials/tab_seo_fields.tpl');
}
}
......@@ -17,6 +17,13 @@ services:
tags:
- { name: core.eventListener, event: core.layout.meta, method: renderSeoMetaTags }
seo.event.on_layout.seo_render_form_fields_listener:
class: ACP3\Modules\ACP3\Seo\Event\Listener\OnLayoutSeoRenderFormFieldsListener
arguments:
- '@core.view'
tags:
- { name: core.eventListener, event: seo.layout.render_form_fields, method: renderSeoFormFields }
seo.event.update_seo_cache_on_model_after_save_listener:
class: ACP3\Modules\ACP3\Seo\Event\Listener\UpdateSeoCacheOnModelAfterSaveListener
arguments:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment