0

I'm making a newspaper site and would like to manually lay out and embed a specific set of articles for the front page. Is there a way I can manually code the layout in columns and embed specific articles?

I don't want or expect the articles to be automatically populated when new content is published; I'd like this to be a manual process. Here's an example similar to what I'm hoping to accomplish pulled from today's New York Times layout:

Today's New York Times

  • 2
    You can look at Layout Builder - it's a part of core now: drupal.org/docs/8/core/modules/layout-builder – Jaypan May 21 at 15:04
  • @Jaypan thank you, that is a great start for the actual layout. However, it's unclear from the Layout Builder documentation how I can link to a specific article's summary (or full article from within a block/custom Block.) I looked at this question. Are those seven-year-old answers up-to-date? Do I really need a module to do this? – glenviewjeff May 21 at 21:11
  • It seems that answers the question I referred to above are obsolete. Here's how to do it in Drupal 8. – glenviewjeff May 21 at 21:45
2

There is (as often) more than one way of solving this.

The dirty and easy way of doing it is with Blocks and Regions, like in Drupal 7. You'll need regions in your theme to be laid out the way you want (and be responsive). Then you manually add nodes/blocks to the regions you have laid out. Even the method of choosing nodes/blocks can be done in different ways.


The sophisticated way of building such a page is with the Layout builder and Paragraphs or a similar module that allows you to reference things.

One Content Type will serve as the container for the layout and all the other content you want shown there. Although it's possible to apply it to only the one node, the one you'll be using for the front page, you decide what makes sense structurally and procedurally in your project.

With Paragraphs you create different reference possibilites for the content you want displayed, and then arrange them with the Layout builder. The Paragraphs and Layout builder parts are usually done up front, you build them once and have it ready when new content is created.

When you publish new nodes and want to update the front page node to show it you will only have to change the references within the front page node to keep the layout and have different content in each "box area".

You can, of course, create more than one layout in your theme, so when needed also choose a different layout for the new content combination.

It's a super powerfull new approach in D8 that makes your Drupal site feel like a website builder software. It does require some effort up-front, so it all depends on your specific needs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.