Working with blocks in Drupal 7

Working with blocks in Drupal 7, Blocks are type of content that can be placed on any region of website, such as footer or sidebar on front end of your website. Any block can be moved from sidebar to footer and footer to sidebar easily by drag and drop. Normally these blocks can be visible after enabling modules or after creating a view.

Working with blocks in Drupal 7 is an article in the series of Step by step guide to learn drupal7.

#Part 2 @ Day 4

Here in Working with blocks in Drupal 7, you will learn these

  1. Creating a block in Drupal 7
  2. Changing region of block in Drupal 7
  3. updating block’s content
  4. Deleting block
1

Creating a block in Drupal 7

Block is a box of content, which can be placed on any region in drupal website.

  1. Navigate to the Blocks page Structure => Blocks.
    Normally the url is http://example.com/admin/structure/block

    Creating Block in Drupal 7 Step one

    Creating Block in Drupal 7 Step one

  2. From that screen, click on Add Block Link.
  3. On the next screen, it will display the fields, which you need to fill. And the url is http://example.com/admin/structure/block/add
      1. Enter the Block title, it’ll be displayed as heading of block, If you want to remove block title then enter <none> in block title field.
      2. Block Description, this field is mandatory, and this value is shows on Blocks administration page.
      3. Fill in the Block body, This is the content of block, Whether it’s text or html.
      4. Next you need to select Text format, based on permissions.
      5. Next from under Region Settings, select the region on default activated template, if you’r website has multiple themes activated.
      6. Visibility Settings, in this we can control on which it’ll be shown, for which roles and all those.
      7. Next click on Save Settings button.
    Creating Block in Drupal 7 Step Two

    Creating Block in Drupal 7 Step Two

  4. After saving, you’r Block will be show on drupal front end.
2

Changing region of a block

Here i’ll change the region of a block. In drupal, region is a specific position in drupal theme. If a block is assigned to any region, it will be shown on that theme position.

  • How to find where a region will be shown on front end.
  1. Navigate to Blocks administration page, Structure => Blocks. And the url is http://example.com/admin/structure/block.
  2. Click on this icon and drag to rearrange or reorder.
    Changing Block region in drupal 7

    Changing Block region in drupal 7

  3. Or else from select list choose a region, after choosing region. Block will be moved to that specific region.
3

Updating Block’s Content

Here you can update block’s content.

  1. Navigate to the Blocks  Administration page Structure => Blocks.
    Normally the url is http://example.com/admin/structure/block
  2. From right next to block, click on configuration link.
    Updating Blocks content in Drupal 7

    Updating Blocks content in Drupal 7

  3. Then you an update block’s content.
4

Deleting a Block

Here by following these steps we can delete a block.

  1. Navigate to the Blocks Administration page Structure => Blocks.
    Normally the url is http://example.com/admin/structure/block
  2. On this screen, next to block you find a link. click on Delete button to delete that block.
    Deleting Blocks content in Drupal 7

    Deleting Blocks content in Drupal 7

  3. Again confirm by clicking on Delete button.

I hope this article helped you to lean working with blocks in drupal 7. To get latest news and updates follow us on twitter & facebook, subscribe to newsletter. If you have any feedback please let us know by using comment form.

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe