Problem/Motivation
Creating articles with Thunder works great, you can easily add new paragraphs, change the order of them and tell stories in different ways. But when it comes to adding a new landing page or to change the looks of your homepage or a channel page, you’ll need some technical knowledge. This is far from convenient since editors and marketing professionals need to create new sites in short time and on their own.
We want to provide a feature which makes it possible to add and edit landing pages and layouts for different content types and taxonomy terms, such as channels and tags. This feature is meant to be used by site-builders, developers and other mainly non-technical persons who are responsible for the creation of custom pages or campaign pages.
Proposed resolution
There are several components that are needed for this feature.
a.) Base layout
The starting point for creating a new landing page will be one of several predefined templates. It will be possible for developers or site-builders to add new templates. A starting template can be simple (for example, one column or two columns) or it can be more complicated (for example, grid or bricks layout). These base templates will define how the layout behaves for responsive designs, too.
The creator of the landing page should be able to define user rights for specific regions. With this functionality, it would be possible to distribute responsibility on one single landing page to different people.
b.) Context where layout will be used
In some cases, you’ll need a layout for your whole website, but in other cases, it should only apply to the homepage, a channel page or a special landing page for a marketing campaign. Therefore it has to be possible to define the context, where the layout is going to be used.
Multiple options can be defined and combined, for example:
- no context (that will make the layout the default layout for the whole website)
- a specific content type or entity type (the layout will for example only apply to article pages or video pages)
- a taxonomy term page (e.g. a special layout for a channel page or tag term page)
- the home page or any other landing page
c.) Elements of layout (blocks)
The basic elements of the layout will be blocks. It will be possible to use default blocks provided by Drupal Core, but also to create and use new block types. It has to be easy to find the block you look for in the list of blocks. So there has to be a good way to search for it.
The placing of blocks in the layout has to be easy, e.g. with just a few clicks or by dragging them from a side tray and drop them wherever you need them. After the block is placed, it has to be easy to change its position between regions or to reorder the blocks by dragging and dropping.
The most important block type will be the one for displaying content lists (for example, articles, media entities, etc.). It has to be possible to configure the view mode used for displaying the content, so you can decide if it shows a list of teasers, fully rendered content or any other custom created and defined view mode.
We will provide the following blocks:
- entity list block
- single entity block (for example, image, gallery, riddle, etc.)
- web form block
- default blocks from Drupal Core
d.) Entity lists
Lists will be automatically filled with entities based on some rules (for example, all articles ordered by publishing date, or all articles with galleries, etc.), but there will be also manually defined lists with selected and ordered entities. It should be possible to create an ad-hoc list for the block or to use an existing list created and predefined by a developer or site-builder. It should be also possible to save an ad-hoc created list as a new named list for future uses.
For the list block, it has to be possible to overwrite the selected list with manually picked entities or another block on specific positions in the list (for example, display a manually selected article on the first position in the list and an advertising block on the third position).
Since the defining of lists is complex and it should support any combination of rules, we want to use a search functionality to define lists and sort them. It should be possible to use a defined list over multiple blocks with custom overwrites defined for every block.
It will be possible to configure a block to display unique entities across the whole landing page or to display entities from an assigned list without keeping uniqueness across the whole landing page. For example, a top stories block at the top of the page displays an article unique over the whole page. A second block that displays articles from the news section will also contain unique articles across the whole page. Thus, it's not possible that the same article appears in both blocks. But a third block at the bottom of the page that displays list of articles with video stories could display the articles displayed in one or both previously mentioned blocks.
Additionally, we want to introduce a grouping in lists, where we can define additional filtering rules (for example, list all recent articles, and in this list show at the beginning two articles which are from the news section, followed by two articles from the events section, and so on).
All that new functionality provided by the list block could be really useful inside an article, too. That's why we would like to provide the block paragraph type, where a list block can be used as well as potentially any other block type.
The cloning of an already created and defined layout would be useful to easily create a new landing page that would be used in another context. A preview of the landing page has to be available in the responsive device preview during the editing of the layout, so that the creator of the landing page can see how the page looks like on different devices.
Remaining tasks
The general idea when it comes to the realization of the desired goals is to first implement the missing independent parts and put them to use as fast as possible. That's why we are thinking to approach the realization of the goals in following order:
- possibility to define and name a sorted list of entities
- the list block where defined list will be put to use
- the list block paragraph type, where the first part of the realization will be wrapped up and we will have a first usable feature
- predefined base layout templates, where the existing blocks will be usable
- context definition for the created layout
After that, we will have all required elements for the creation of the landing page.
Events
Landing pages and layouts (BOF) - DrupalCon Vienna 2017 added Comment #5 with list of conclusions and ideas
Comments
Comment #2
juliapradel commentedComment #3
mtodor commentedComment #4
samuel.mortensonI was asked to review this based on my layout experience as a Panels, Lightning, and Demo Framework maintainer. This is copied+pasted from an email so the tense may be a bit awkward:
As a Panels maintainer I'm a little biased here, but Panelizer addresses many of the key points you made in the document. "Base layout" is covered by the Layout API support, "Elements of layout" is covered by the use of Blocks in Panels, and "Context where layout will be used" is covered by the core feature set of Panelizer. Panelizer also makes use of Panels IPE, which is one of the only inline editors for Landing Pages in Drupal 8.
It's worth noting that if Paragraphs had an inline editor (Quick Edit support), and layout support, I would push for my team to use Paragraphs instead of Panels for Landing Page creation. Paragraphs is simple, easy to understand, and enforces good architecture. I think this gives it a distinct advantage over Panels in a headless scenario. If I had more time, and probably funding, I would love to build out an inline editor for Paragraphs. :-)
I liked reading through the "Entity lists" section, this is a problem that we've never been able to solve at Acquia with Panels, and something that I'd like to see improved. My team uses a module I maintain, Content Browser (http://drupal.org/project/content_browser), which provides a simple block that can be used with Panels IPE to quickly add arbitrary content to a page. For lists with filters, I proposed to my team a long time ago that we should port https://www.drupal.org/project/simpleviews to Drupal 8, which offers a simplified Views interface that would fit nicely within a Landing Page context.
Ignoring the technical decisions for a bit, there are some Landing Page needs that are not covered in your document that we struggle with a lot:
Moderation needs to work with Landing Pages - i.e if I place a Custom Block or a Paragraph on a published page, then make a draft and edit a field on the Block/Paragraph, the published page should not have those changes until the draft is published. This is surprisingly hard problem that is only now being addressed in Lightning.
Inline editing needs to work to build Landing Pages, and should be competitive with other products like Squarespace and Wordpress (look up Divi 3.0). I wrote Panels IPE ages ago, which is functional but didn't end up as nice as I would like it to be.
Block Plugins, while powerful, are not always relevant to a Landing Page experience. My team spends a lot of time restricting the Block listing in Panelizer to only include a handful of Blocks we know are designed to work with Landing Pages. It's important to not overwhelm users with too many options.
Comment #5
mtodor commentedAt DrupalCon Vienna 2017 we came to a conclusion that instead of custom implementation of list block, views should be used.
Here is a list of solution proposals for defined components in the issue summary.
Other thoughts and ideas (randomly ordered) in order to achieve a wanted goal:
Comment #6
moppedanne commentedHi!
We had some really good conversations about this topic during the Thunderdays and we will use this issue to follow it up instead of creating a new one. Stephan @szeidler will follow up the an update on where we are and some lines about our needs.
Looking forward to this!
Comment #7
Ramsalt Lab commentedJust adding to @moppedanne's comment.
From our experience publishers have specific needs for their frontpages that include custom article ordering, selecting display style per article, injecting other content within the frontpage flow (ie. ads, newsletter signup, other content lists etc). We have gathered their requirements and written a generic Editorial Frontpage Specifications (draft).
Editorial Frontpage Specifications (open for comments): https://docs.google.com/document/d/1lcwgO8eO1epwbhjugPg9u5cEl8XfBdlOzQ-u...
This was posted first on https://ramsalt.com/news/building-flexible-frontpage-drupal-and-thunder-...
Comment #8
Yuri commentedI'm interested if there is progress in this or that it not on the road map.
Comment #9
mtodor commented@Yuri we made some progress there.
We have created a module that provides "Entity lists". The module is currently in working prototype/demo state. You can find it here if you want to give it a try: https://www.drupal.org/project/custom_list. There is no documentation, so if you need some help PM me on slack or so.
We didn't do more, because we want to be sure, that we are going in a good direction. Next step is to demo that to product owners and editors, at least to whom we have access and collect feedback. From that feedback, we would like to define MVP and implement that.
It's designed to be used with Layout Builder. For landing pages, the best option is to create custom content type without any fields and enable "Allow each content item to have its layout customized." for it. Then you can customize a single entity with Layout Builder and custom list provides one type of building blocks. To put it simply, it provides a teaser list.