Skip to content

Commit

Permalink
Merge pull request #146 from AlexanderBlanchardAC/24.12.00_grapes_pag…
Browse files Browse the repository at this point in the history
…e_title_control

24.12.00 grapes page title control
  • Loading branch information
AlexanderBlanchardAC authored Dec 3, 2024
2 parents 7d838b8 + d2eb6f3 commit 18757df
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<title>{$title|escape: 'html'}</title>
</head>
<body>
<h1>{$title|escape: 'html'}</h1>
{if $showTitleOnPage}
<h1>{$title|escape: 'html'}</h1>
{/if}
<div id="content">
{$templateContent}
</div>
Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.12.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

### Web Builder Updates
- Remove edit button in admin view of Grapes JS Pages as breadcrumbs allow navigation back to the editor and are in keeping with the rest of Aspen. (*AB*)
- Add the ability for users to control whether the title they assign to their Grapes JS page is displayed when viewing as a page. (*AB*)

// Chloe - PTFSE

Expand Down
2 changes: 2 additions & 0 deletions code/web/services/WebBuilder/GrapesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function launch() {
global $interface;

$title = $this->grapesPage->title;
$showTitleOnPage = $this->grapesPage->showTitleOnPage;
$interface->assign('id', $this->grapesPage->id);
$interface->assign('contents', $this->grapesPage->getFormattedContents());
$canEdit = UserAccount::userHasPermission( 'Administer All Grapes Pages',
Expand All @@ -56,6 +57,7 @@ function launch() {
}
$interface->assign('templateContent', $templateContent);
$interface->assign('title', $title);
$interface->assign('showTitleOnPage', $showTitleOnPage);

$this->display('grapesPage.tpl', $title, '', false);
}
Expand Down
7 changes: 7 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.12.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ function getUpdates24_12_00(): array {
"ALTER TABLE indexing_profiles ADD COLUMN treatItemsAsEcontent VARCHAR(512) DEFAULT 'ebook|ebk|eaudio|evideo|online|oneclick|eaudiobook|download|eresource|electronic resource'",
],
], //add_treatItemsAsEcontent_field
'optional_show_title_on_grapes_pages' => [
'title' => 'Optional Show Title on Grapes Pages',
'description' => 'Make displaying a given title on a grapes pae optional',
'sql' => [
'ALTER TABLE grapes_web_builder ADD COLUMN showTitleOnPage TINYINT NOT NULL DEFAULT 1'
],
], //optional_show_title_on_grapes_pages

//chloe - PTFS-Europe

Expand Down
8 changes: 8 additions & 0 deletions code/web/sys/WebBuilder/GrapesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class GrapesPage extends DB_LibraryLinkedObject {
public $__table = 'grapes_web_builder';
public $id;
public $title;
public $showTitleOnPage;
public $urlAlias;
public $teaser;
public $templatesSelect;
Expand Down Expand Up @@ -46,6 +47,13 @@ static function getObjectStructure($context = ''): array {
'maxLength' => 100,
'required' => true,
],
'showTitleOnPage' => [
'property' => 'showTitleOnPage',
'type' =>'checkbox',
'label' => 'Display Title on Page',
'description' => 'Whether or not to display the title on the Grapes Page',
'default' => 1,
],
'urlAlias' => [
'property' => 'urlAlias',
'type' => 'text',
Expand Down

0 comments on commit 18757df

Please sign in to comment.