Problem/Motivation

Site builders ask for an easy way to build the homepage with a page layout.
Today it takes a conditional layout with a Pages condition on <front>, dragged to the top of the list, as the Build a homepage tutorial explains.
A conditional layout above it on /node/* takes the front page when that is set to /node/1.

Proposed resolution

A homepage is a page layout whose only condition is Pages <front>, as the default is one with none, so no config key is added.
A "Create the homepage" action next to the default one saves it with a fixed ID and label, a locked condition and a Minimal or Blank starting point, and shows the current front page.
The homepage is checked first and the default last, whatever their weight.
<front> follows the front page setting on every request, and saving that setting already invalidates the rendered cache.

Remaining tasks

  • PageLayoutInterface::isHomepage(), and the homepage sorted first in AccessControlHandler::loadCurrentPageLayout().
  • Route, action and access for the homepage, offered while the site has none.
  • PageLayoutForm: the homepage mode.
  • Page layouts list: homepage rows on top, not draggable.
  • Docs: build-a-homepage.md Step 6 and page-layout.md.
  • Tests: kernel for isHomepage() and the order, functional for the homepage action.

User interface changes

A "Create the homepage" action on the page layouts list, and the homepage rows on top of it.

API changes

PageLayoutInterface::isHomepage() is added.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Title: Add a homepage page layout, one default and one homepage per theme, and a Theme column in the lists » Add a homepage page layout
Issue summary: View changes

  • mogtofu33 committed 5a2b1417 on 1.0.x
    feat: #3632193 Add a homepage page layout
    
    By: mogtofu33
    
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)