Adding Blocks

Block administration offers not only flexibility to determine where existing blocks appear, but also the ability to create completely new blocks.

To create a new block, click the Add Block tab on the block administration page (admin/ block/add). The Name field will appear as the heading of your block on the page. The field is not mandatory and does not need to be unique. To make sure you can identify your new block on the administration pages, give it a unique description. This field is also not mandatory, but if you add a description, it must be unique.

Next, choose an input format and write the body of your block. Since you can elect to write PHP code in the block, the possibilities for what you can do are endless. In fact, writing PHP in blocks is one of the easiest and most accessible ways to extend your Drupal site. Exercise 2-3 demonstrates how to create a new block using PHP code.

Was this article helpful?

0 0

Post a comment