Skip to content

Commit

Permalink
Merge pull request #2250 from Daniel-KM/feat/site_page_class
Browse files Browse the repository at this point in the history
Added a layout setting to set the class for body of a site page.
  • Loading branch information
kimisgold authored Dec 17, 2024
2 parents a36e145 + 61a4fc1 commit 27f8dff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/src/Controller/Site/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function showAction()
'site' => $site->id(),
])->getContent();

$pageBodyClass = 'page site-page-' . preg_replace('([^a-zA-Z0-9\-])', '-', $slug);
$pageBodyClass = 'page '
. $page->layoutDataValue('class')
. ' site-page-' . preg_replace('([^a-zA-Z0-9\-])', '-', $slug);

$this->viewHelpers()->get('sitePagePagination')->setPage($page);

Expand Down
10 changes: 10 additions & 0 deletions application/src/Form/PageLayoutDataForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ public function init()
'id' => 'template-name',
],
]);
$this->add([
'name' => 'o:layout_data[class]',
'type' => 'text',
'options' => [
'label' => 'Class', // @translate
],
'attributes' => [
'id' => 'page-layout-data-class',
],
]);
$this->add([
'type' => 'number',
'name' => 'o:layout_data[grid_column_gap]',
Expand Down

0 comments on commit 27f8dff

Please sign in to comment.