1

I have a question to create a site in Drupal 8.

It is a website with about 60 basic pages, but each of them has different relationships, paragrphs, media.

My question is, how can I assign different fields per page and that the type of content does not grow monstrous? I am trying to reuse fields, but it has been very complicated for me.

  • Create different content types. Define a content model. – Kevin May 6 at 4:28
  • To help maintain the number of field bases, create a “prototype” content type for example, create all your fields there, then reuse them in the content types used to make pages. – Prestosaurus May 6 at 4:50
  • Or just use Paragraphs to let your site be filled with different Paragraph types. Seems to be a primarily opinion-based thing, no? – leymannx May 6 at 5:34
  • I think the problem might be the question. A single content type will always have the same fields so “page” cannot be different among itself. Paragraphs would seem like the correct answer to the question of different fields to one content type. – Prestosaurus May 6 at 15:05
0

IIUC you need the Bricks​ module. This module is similar to Paragraphs but a lot more abstract and allows for the customized options you mention.

You will have to create all the possible "Bricks" that can be found on your pages, then it won't be difficult to create each page with the custom structure it's supposed to have.

You don't have to use the Layout builder if your cases aren't that complex. The most important thing is to create some strategy around your different cases, analyze your needs so you know what different combinations need to be created. Go for the simplest possible solution, don't overcomplicate needlessly or you'll create a mess that is difficult to maintain.

  • 1
    Why not just go with what core provides? You could swap Paragraphs for Layout Builder and get both layouts and componentized content. As Layout Builder and modules enhancing it mature, I don’t know how long offerings like Bricks can last. – Kevin May 7 at 3:59
  • @Kevin I see how my answer might be misread: when I mention the Layout builder I meant strictly using it with the Bricks because you can use Bricks with it but it isn't necessary. Are you suggesting using Layout builder instead of Bricks? Because I don't see this question as being about layout, but about the complexity of a site's structure where there is a lot of pages with different combinations of elements. Bricks allows you to reuse the references while Paragraphs can't be reused (they aren't references!) hence I suggested Bricks after analyzing the structure situation. – prkos May 7 at 23:44

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.