diff --git a/templates/PragueTennisCamp/Handler.php b/templates/PragueTennisCamp/Handler.php index f7427478..077566e1 100644 --- a/templates/PragueTennisCamp/Handler.php +++ b/templates/PragueTennisCamp/Handler.php @@ -66,46 +66,22 @@ class Handler implements TemplateHandler 'module' => 'StaticPages', 'templateName' => 'staticpages::admin.templatePath' ], + + [ + 'module' => 'ArticleList', + 'alias' => config('articlelist.alias'), + 'templateName' => 'articlelist::module.templatePath' + ], + [ + 'module' => 'Article', + 'alias' => config('articleias'), + 'templateName' => 'article::module.templatePath' + ], + [ 'module' => 'ContactForm', 'templateName' => 'contactform::admin/adminMenu.templatePath' ], ]; } - - /** - * Prepare Content object to be rendered using Blade template - * - * @param Content $content - */ - public static function beforeRender(Content & $content) - { -// if ($content->isHomepage) { - $category = Category::where('url', 'trenersky-tym') - ->first(); - - $content->traineeTeamCategory = $category; -// } - } - - /** - * 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) - { - } } \ No newline at end of file diff --git a/templates/PragueTennisCamp/Pipeline/AddTraineeTeamCategory.php b/templates/PragueTennisCamp/Pipeline/AddTraineeTeamCategory.php new file mode 100644 index 00000000..bdbcd28e --- /dev/null +++ b/templates/PragueTennisCamp/Pipeline/AddTraineeTeamCategory.php @@ -0,0 +1,23 @@ +first(); + + $page->traineeTeamCategory = $category; + } +} \ No newline at end of file diff --git a/templates/PragueTennisCamp/Providers/ServiceProvider.php b/templates/PragueTennisCamp/Providers/ServiceProvider.php index 798462ba..0593c3ed 100644 --- a/templates/PragueTennisCamp/Providers/ServiceProvider.php +++ b/templates/PragueTennisCamp/Providers/ServiceProvider.php @@ -3,6 +3,7 @@ namespace Templates\PragueTennisCamp\Providers; use App\CMS\Helpers\Template; use Modules\ContactForm\Widgets\Form\Presenter; +use Templates\PragueTennisCamp\Pipeline\AddTraineeTeamCategory; class ServiceProvider extends \Illuminate\Support\ServiceProvider { /** @@ -20,5 +21,8 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider { return; Presenter::$template = Template::name('widgets.contact.form'); + + $pipeline = app('displayPipeline'); + $pipeline->add(AddTraineeTeamCategory::class); } } \ No newline at end of file