From 03f05a3e1fb57afcbe0b1bb9c058b7392e8e2627 Mon Sep 17 00:00:00 2001 From: Miro Yovchev <2827783+myovchev@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:49:36 +0300 Subject: [PATCH 1/3] Add layout widget support and enhance page structure - Introduced '@apostrophecms/layout' widget in home and default page areas. - Updated layout styles to allow for a wider main content area. - Improved HTML structure for better layout management. --- lib/area.js | 6 ------ modules/@apostrophecms/home-page/index.js | 6 ++++++ modules/asset/ui/src/scss/_layout.scss | 2 +- modules/default-page/index.js | 13 +++++++++++-- modules/default-page/views/page.html | 7 +++++-- 5 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 lib/area.js diff --git a/lib/area.js b/lib/area.js deleted file mode 100644 index 584365fb..00000000 --- a/lib/area.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - '@apostrophecms/image': {}, - '@apostrophecms/video': {}, - '@apostrophecms/html': {}, - '@apostrophecms/rich-text': {} -}; diff --git a/modules/@apostrophecms/home-page/index.js b/modules/@apostrophecms/home-page/index.js index 29664d44..28ded53a 100644 --- a/modules/@apostrophecms/home-page/index.js +++ b/modules/@apostrophecms/home-page/index.js @@ -8,6 +8,12 @@ export default { type: 'area', options: { widgets: { + '@apostrophecms/layout': { + columns: 6, + defaultSpan: 3, + minSpan: 1, + gap: '1rem' + }, '@apostrophecms/rich-text': {}, '@apostrophecms/image': {}, '@apostrophecms/video': {} diff --git a/modules/asset/ui/src/scss/_layout.scss b/modules/asset/ui/src/scss/_layout.scss index 95d9e685..1a90df37 100644 --- a/modules/asset/ui/src/scss/_layout.scss +++ b/modules/asset/ui/src/scss/_layout.scss @@ -22,7 +22,7 @@ body { main, .bp-footer { width: 100%; - max-width: 800px; + max-width: 1200px; margin-left: auto; margin-right: auto; } diff --git a/modules/default-page/index.js b/modules/default-page/index.js index abb52d41..283c71be 100644 --- a/modules/default-page/index.js +++ b/modules/default-page/index.js @@ -6,6 +6,14 @@ export default { fields: { add: { main: { + type: 'area', + options: { + widgets: { + '@apostrophecms/layout': {}, + } + } + }, + content: { type: 'area', options: { widgets: { @@ -14,14 +22,15 @@ export default { '@apostrophecms/video': {} } } - } + }, }, group: { basics: { label: 'Basics', fields: [ 'title', - 'main' + 'main', + 'content' ] } } diff --git a/modules/default-page/views/page.html b/modules/default-page/views/page.html index a5925703..33247120 100644 --- a/modules/default-page/views/page.html +++ b/modules/default-page/views/page.html @@ -6,8 +6,11 @@ {% extends "layout.html" %} {% block main %} -
-

{{ data.page.title }}

+

{{ data.page.title }}

+
{% area data.page, 'main' %}
+
+ {% area data.page, 'content' %} +
{% endblock %} From 115101adaf0e6e537a26c1dbdb4bfd7700974d2c Mon Sep 17 00:00:00 2001 From: Miro Yovchev <2827783+myovchev@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:23:24 +0300 Subject: [PATCH 2/3] Explicitely improve the layout columns to showcase Layout content configuration --- .../@apostrophecms/layout-column-widget/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/@apostrophecms/layout-column-widget/index.js diff --git a/modules/@apostrophecms/layout-column-widget/index.js b/modules/@apostrophecms/layout-column-widget/index.js new file mode 100644 index 00000000..2bdc24b1 --- /dev/null +++ b/modules/@apostrophecms/layout-column-widget/index.js @@ -0,0 +1,16 @@ +// Modify the layout column widget to allow the desired content types +// in the Layout widget. +export default { + fields: { + add: { + content: { + type: 'area', + options: { + '@apostrophecms/rich-text': {}, + '@apostrophecms/image': {}, + '@apostrophecms/video': {} + } + } + } + } +}; From 7d219ddb99690bb43e62a99b24a48a3cbfea32c7 Mon Sep 17 00:00:00 2001 From: Miro Yovchev <2827783+myovchev@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:26:41 +0300 Subject: [PATCH 3/3] Fix schema typo --- modules/@apostrophecms/layout-column-widget/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/@apostrophecms/layout-column-widget/index.js b/modules/@apostrophecms/layout-column-widget/index.js index 2bdc24b1..f112d6a8 100644 --- a/modules/@apostrophecms/layout-column-widget/index.js +++ b/modules/@apostrophecms/layout-column-widget/index.js @@ -6,9 +6,11 @@ export default { content: { type: 'area', options: { - '@apostrophecms/rich-text': {}, - '@apostrophecms/image': {}, - '@apostrophecms/video': {} + widgets: { + '@apostrophecms/rich-text': {}, + '@apostrophecms/image': {}, + '@apostrophecms/video': {} + } } } }