How to Create Content Blocks in Drupal

Don’t forget to subscribe to our YouTube channel to stay up-to-date.

Adding custom HTML to your Drupal site is easy with content blocks – no coding required. Content blocks are great for inserting subscription forms, social media buttons, promo banners, or custom formatting.

Let’s walk through the steps to create a content block and place it on your Drupal site:

Enabling Block Content

First, ensure the “Block Content” module is enabled. Navigate to Extend and search for “block”. If it’s not already enabled, check the box next to “Block Content” and click Install.

Creating a Content Block

  1. Go to Content, then Blocks.
  2. Click on “Add content block”.
  3. Enter a descriptive title for your block in the “Block description” field.
  4. In the Body section, paste your HTML code snippet.
  5. Choose the appropriate “Text format” (e.g., Basic HTML).
  6. Click Save.

Placing the Block in a Region

  1. Navigate to Structure, then “Block layout”.
  2. Click “Demonstrate block regions” to visualize the available regions in your theme.
  3. Choose the region where you want to place your block, like the Sidebar.
  4. Click Place block within that region.
  5. Search for your custom block using the title you provided and click Place block.
  6. In the “Configure block” window, adjust settings like block title visibility if needed.
  7. Click “Save block” then “Save blocks” on the main Block layout page.

The content block will now display on your site’s front end in the selected region.

Content block permissions can be managed under People > Permissions. Visibility settings allow further control over where blocks appear.

With content blocks, integrating HTML snippets into Drupal is simple and efficient.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top