FEATURE: prepare hotels template

This commit is contained in:
Michal Kváček
2017-03-13 12:08:45 +01:00
parent ce58b325c8
commit 8658ea1d39
8 changed files with 106 additions and 34 deletions
@@ -0,0 +1,26 @@
<?php
namespace Templates\PragueTennisCamp\Pipeline;
use App\CMS\Contracts\Content\DisplayPipeline\Process;
use App\Models\Content\Content;
use Modules\Categories\Entities\Category;
class AddHotelsCategory implements Process
{
/**
* Process and modify given page
*
* @param Content $page
*
* @return mixed
*/
function handle(Content & $page)
{
if ($page->template == 'staticpages::pageWithHotels') {
$category = Category::where('url', 'hotels')
->first();
$page->hotelsCategory = $category;
}
}
}
@@ -5,7 +5,8 @@ use App\CMS\Contracts\Content\DisplayPipeline\Process;
use App\Models\Content\Content;
use Modules\Categories\Entities\Category;
class AddTraineeTeamCategory implements Process {
class AddTraineeTeamCategory implements Process
{
/**
* Process and modify given page
*
@@ -15,9 +16,11 @@ class AddTraineeTeamCategory implements Process {
*/
function handle(Content & $page)
{
$category = Category::where('url', 'trenersky-tym')
->first();
if ($page->template == 'staticpages::traineeTeam' || $page->isHomepage == true) {
$category = Category::where('url', 'trenersky-tym')
->first();
$page->traineeTeamCategory = $category;
$page->traineeTeamCategory = $category;
}
}
}