From 1652c6dbb3a2ff7b1c248a4abc545eddf530653e Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Fri, 20 Sep 2024 10:20:38 +0100 Subject: [PATCH 1/4] feat: Make Showing Title on Grapes Pages Optional Add a checkbox on the Grapes Page to make showing the given title on the rendered Grapes page optional. --- .../themes/responsive/WebBuilder/grapesPage.tpl | 4 +++- code/web/services/WebBuilder/GrapesPage.php | 4 +++- code/web/sys/WebBuilder/GrapesPage.php | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl b/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl index 30d60d1f1a..ad87af81e7 100644 --- a/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl +++ b/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl @@ -8,7 +8,9 @@ {$title|escape: 'html'} -

{$title|escape: 'html'}

+ {if $showTitleOnPage} +

{$title|escape: 'html'}

+ {/if}
{$templateContent}
diff --git a/code/web/services/WebBuilder/GrapesPage.php b/code/web/services/WebBuilder/GrapesPage.php index aaae1e742a..478c46d1c0 100644 --- a/code/web/services/WebBuilder/GrapesPage.php +++ b/code/web/services/WebBuilder/GrapesPage.php @@ -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()); $editButton = $this->generateEditPageUrl(); @@ -58,6 +59,7 @@ function launch() { } $interface->assign('templateContent', $templateContent); $interface->assign('title', $title); + $interface->assign('showTitleOnPage', $showTitleOnPage); $this->display('grapesPage.tpl', $title, '', false); } @@ -68,7 +70,7 @@ function canView(): bool { function generateEditPageUrl() { $objectId = $this->grapesPage->id; - $templatesSelect - $this->grapesPage->templatesSelect; + $templatesSelect = $this->grapesPage->templatesSelect; return '/services/WebBuilder/GrapesJSEditor?objectAction=edit&id=' . $objectId . '&tempalteId=' . $templatesSelect; } diff --git a/code/web/sys/WebBuilder/GrapesPage.php b/code/web/sys/WebBuilder/GrapesPage.php index 721fdd3fbd..eb5f67295f 100644 --- a/code/web/sys/WebBuilder/GrapesPage.php +++ b/code/web/sys/WebBuilder/GrapesPage.php @@ -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; @@ -46,6 +47,14 @@ static function getObjectStructure($context = ''): array { 'maxLength' => 100, 'required' => true, ], + //TODO:: Add showTitleOnPage to db table for grapes page and add conditional check on .tpl file + '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', From 7bcc8407d98e11400dfadf256681c6f12e5a6e22 Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Mon, 30 Sep 2024 15:43:07 +0100 Subject: [PATCH 2/4] feat: Adjust positioning of edit button on page --- code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl b/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl index ad87af81e7..03aca3157a 100644 --- a/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl +++ b/code/web/interface/themes/responsive/WebBuilder/grapesPage.tpl @@ -3,7 +3,7 @@ {if $canEdit} -
+
{/if} {$title|escape: 'html'} From 6767133af2fceea84d968d136f61d6ad4b57a75a Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Fri, 4 Oct 2024 15:29:41 +0100 Subject: [PATCH 3/4] feat: Update correct db file --- .../DBMaintenance/version_updates/24.11.00.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 code/web/sys/DBMaintenance/version_updates/24.11.00.php diff --git a/code/web/sys/DBMaintenance/version_updates/24.11.00.php b/code/web/sys/DBMaintenance/version_updates/24.11.00.php new file mode 100644 index 0000000000..6193618ef8 --- /dev/null +++ b/code/web/sys/DBMaintenance/version_updates/24.11.00.php @@ -0,0 +1,16 @@ + [ + 'title' => 'Optional Show Title On Grapes Pages', + 'description' => 'Make displaying a given title on a grapes page optional', + 'continueOnError' => false, + 'sql' => [ + 'ALTER TABLE grapes_web_builder ADD COLUMN showTitleOnPage TINYINT NOT NULL DEFAULT 1' + ], + ],//optional_show_title_on_grapes_pages + ]; +} \ No newline at end of file From cbe022bb4468ef46d7d3193f023f5c2b9432fec8 Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Fri, 4 Oct 2024 15:34:50 +0100 Subject: [PATCH 4/4] chore: Update Change Logs --- code/web/release_notes/24.11.00.MD | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 code/web/release_notes/24.11.00.MD diff --git a/code/web/release_notes/24.11.00.MD b/code/web/release_notes/24.11.00.MD new file mode 100644 index 0000000000..9e3b55b69e --- /dev/null +++ b/code/web/release_notes/24.11.00.MD @@ -0,0 +1,3 @@ +## Aspen Discovery Updates +### Web Builder - Grapes JS Updates +- Add the ability for users to control whether the title they assign to their Grapes JS pages is displayed when viewing as a page. (*AB*) \ No newline at end of file