FEATURE: prepare hotels template
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user