Skip to content

PRO-7846: Layout widget#82

Draft
myovchev wants to merge 3 commits into
mainfrom
PRO-7846-layout
Draft

PRO-7846: Layout widget#82
myovchev wants to merge 3 commits into
mainfrom
PRO-7846-layout

Conversation

@myovchev

@myovchev myovchev commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

DO NOT MERGE UNTIL AFTER RELEASE

  • Add Layout widget support
  • Update styles
  • Remove obsolete lib

- 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.
@linear

linear Bot commented Oct 21, 2025

Copy link
Copy Markdown

@myovchev myovchev marked this pull request as draft October 21, 2025 07:51
@myovchev myovchev requested a review from BoDonkey October 21, 2025 07:52

@BoDonkey BoDonkey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite get the second area on the default page. Why break video out to a standalone area?

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is only a draft and I am reviewing prematurely so this is a comment, not a blocker.

I think you should use 12 steps, and also explicitly configure the column widget's allowed contents even if it's the same as the default, so that it is easier for developers to understand how to add widgets to it. Otherwise layout feels like a black box and people reading Bob's documentation site won't really know what to do to add their very first custom widget.

options: {
widgets: {
'@apostrophecms/layout': {
columns: 6,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 12

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not appropriate here, it's tested and feels right in the context of the space it has.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Default page has 12. This also showcases the option override.

Comment thread modules/@apostrophecms/layout-column-widget/index.js
@@ -0,0 +1,18 @@
// Modify the layout column widget to allow the desired content types
// in the Layout widget.
export default {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boutell Explicit define so that it's clear how to modify.

@myovchev

Copy link
Copy Markdown
Contributor Author

I don't quite get the second area on the default page. Why break video out to a standalone area?

@BoDonkey It's a visual thing in the diff view. The widget list is

          widgets: {
            '@apostrophecms/rich-text': {},
            '@apostrophecms/image': {},
            '@apostrophecms/video': {}
          }

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows only one level of layouts. Please demo nested layouts in a way that doesn't allow infinite nesting, and does restrict steps in a nested layout. (This means a subclass is needed.)

See the nested-layout branch for a working example although not in the lineage of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants