What are the Layout Components in Drupal? How do Paragraphs, Field Collections, and Viewfields Enhance Content Presentation?
In Drupal there are a few components to use for layouts of a web page or content type.
- Paragraphs
- Field Collections
- Viewfield or View References
For complex page layouts we use "Paragraphs" module. These paragraphs are collections of fields, that can be re-used into displaying information in different formats. We love paragraphs because they allow you to optionally add content for:
- A slideshow
- A gallery
- two column text
- quicklinks
- An image and inline paragraph
- Accordions
- etc.
We build out different paragraphs by type, and then develop custom displays so you can drag and order paragraphs however you would like your page content laid out.
Some issues with this include complex forms on the add/edit pages of the content type page. Some of the fields required to build out content are extensive, and require a lot of time to add, but they do give you a great result afterward.
Field Collections are our older way of adding a group of fields to a content type. These work just like paragraphs but usually are just a grouping of fields, in a simple way.
Viewfields and or view reference fields you may see on your content type. These allow you to place a view into your page like a paragraph, listing out some relevant information based on a view. For example maybe you want the latest news in the middle of the page, you can reference a latest news view and even supply it arguments if you want a complex filter (or are comfortable with arguments).