Drupal 8: Create custom block with Fields

749
Drupal 8: Create custom block with Fields
Drupal 8: Create custom block with Fields

How to add custom Block in Drupal 8, Drupal provides easy steps to create custom block with your required fields.

Let’s see – How to Create Custom Block in Drupal 8.

Step 1: login with Superadmin.

Step 2: go >> Structure >> Block layout >> Custom block library

After click on Custom block library

  • Blocks: in this, you can use listed blocks.
  • Block types: in this, you can add custom blocks with number of fields.

Select Block types Click on +Add custom block type for more detail see given Pic.

Drupal 8: Create custom block with Fields
Drupal 8: Create custom block with Fields

Step 3: After clicking on +Add custom block type, Add block information Title, Description and save.

Example: I created Block “My First block”.

Click on Manage fields   Add fields. I added two fields title and my pic.

Drupal 8: Create custom block with Fields
Drupal 8: Create custom block with Fields

I have done custom block and how to Assign to second sidebar region and publish content.

Step 4: Go back >> click on Block Layout search Sidebar second (where you want to assign your custom block). >> click on Place block >> click on + Add custom block   select your block write content and save.

Step 5: select options

  • Content type – which content type you want to relate your block.
  • Page – Put restricted.
  • Roles – Select user permission.
  • Regions – Select region where you published your block.
Drupal 8: Create custom block with Fields
Drupal 8: Create custom block with Fields

Save all settings.

Drupal 8: Create custom block with Fields
Drupal 8: Create custom block with Fields

After that open your article see result like article First Image.

LEAVE A REPLY

Please enter your comment!
Please enter your name here