![]() So far we’ve done nothing ground breaking. On the Edit page, check the “Required field” checkbox, scroll to the bottom and click on “Save settings”. Leave the “Field settings” page as the default and click on “Save field settings”.Ĥ. Click on “Add field”, Select Image from “Add a new field” and add Image into Label. Expand the Edit button and click on “Manage fields” on the Banner row.Ģ. We created the Banner paragraph type, let’s now add two fields: Image and Paragraphs (the nested field).ġ. Enter in Banner into Label and click on Save. Go to Structure, “Paragraphs types” and click on “Add a Paragraphs type”.Ģ. The first bit of work that needs to be done is create the container paragraph type.ġ. $ drupal module:download entity_reference_revisions 8.x-1.0-rc4 Now make sure you have Paragraphs and Entity Reference Revisions installed.īelow are the Drush and Drupal Console commands to download and install:ĭrush: $ drush dl paragraphs entity_reference_revisionsĭrupal Console: $ drupal module:download paragraphs 8.x-1.0-rc4 Once the module has been enabled you should see the Content paragraph type. Simply download this sandbox repo and enable it. Don’t worry, you won’t have to reread the last tutorial again. To save time, let’s reuse the paragraph type we created in the last tutorial. ![]() Here is what the end product looks like on a Drupal site. If you want to add any other settings, i.e., parallax configuration, you would place it on the container paragraph. Now, I do understand there’re multiple ways of doing this, but for simplicity we’ll set it using a background style on the paragraph element.Īll nested paragraphs will be rendered inside the container and displayed with the background. When a banner paragraph is created and an image is uploaded, the image will be displayed as a background style. In this tutorial, we’ll create a container paragraph called Banner, it’ll have two fields: image and paragraphs. It’s a paragraph type that has its own paragraph field on it and allows a user to nest paragraph items.īelow is an example of how it’ll be rendered. The concept of a container is fairly simple. ![]() To utilize Paragraphs to its full potential you need to learn how to create a container paragraph type and nest paragraph items. We only skimmed the surface of what the module can really do. ![]() In the last Paragraphs tutorial, you were introduced to the module and we created a basic paragraph type called Content. Want to learn more about Paragraphs? Then check out our online video course called “ Build Edge-to-edge Sites using Paragraphs in Drupal 8“. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |