![]() You have to create a field and implement a hook to output a predefined class option list for each paragraph bundle. I tried the classy paragraphs module for assigning a class to each paragraph. We also can’t use CSS nth-child selector on paragraph, because as soon as the end user changes the paragraph order on the backend, wrong CSS will be applied. ![]() Therefore, we can’t use it for targeting each paragraph section individually. Just like node id, you can’t guarantee that it will be the same on a different server. The default paragraph class has a synchronization issue. Theming paragraphs can be a little tricky. (Make the above 3 paragraph bundles available to this field.)ĥ) Don’t forget to configure permissions to allow anonymous users to view the paragraph content. There is a background image style, don’t forget to change that.ģ) Since our design uses full a width background, I created a template file for a landing page content type and used a page preprocess function to load it.Ĥ) Then I created a landing page content type, removed the body field and added a paragraph field with unlimited cardinality. Here is an example of how I setup a landing page content type:ġ) First, define 3 paragraph bundles: simple, advanced, and blocks paragraphs.ġa) the simple paragraph has a title and body field.ġb) the advance paragraph has a title, body, and field collection fields.ġc) the block paragraph has a title, body and a block reference field (using block reference module, so end user can use embed slider, maps, views block, etc).Ģ) Download and configure the entity background module to allow background color and image for the above 3 paragraph bundles. Set Up Landing Page Content Type with Paragraphs Since Paragraphs is an entity, you can add any field and manage their display mode, just like adding a new content type.Ĭreate a new field of paragraph type on any node, and choose what paragraph bundle this field can reference to. For instance, by using the Paragraphs and entity background modules together, it is possible for the end user to choose background images and colours.ĭefine the paragraph bundles you intend to use using their User Interface (UI). Contributed modules mentioned in this post: However, unlike field collections, paragraphs allow you to choose a different set of fields each time. I feel like it’s a replacement for field collections. If you haven’t used it before, go check it out. Recently, I started using the Paragraphs Module to develop landing pages for Drupal Websites.
0 Comments
Leave a Reply. |