Adding regions to the page template

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:07
    In this section, we're going to talk about replacing the static sidebar content
  • 0:12
    with dynamic blocks output by Drupal.
  • 0:15
    In order to do that, we need to add some new regions to our site.
  • 0:18
    Right now, we've got the region for content here and that's printed out.
  • 0:22
    We also need to add some regions that will allow us to print out our blocks
  • 0:25
    into a left sidebar and a right sidebar, like so.
  • 0:28
    Before we do that, let's take a look at how regions work.
  • 0:32
    In order to do that we'll go to the Structure page
  • 0:36
    and then the Block administration screen.
  • 0:39
    On the Block administration page here,

Adding Regions to the Page Template

Loading...

In this chapter, we add some sidebar and footer regions to the page via the .info files, and printing those new regions out in our page template file, adding some blocks to help with testing. We also talk about Devel and Krumo, and how we can use those to find out everything that is available in out page array, using the dsm() function. While inspecting out page array, we point out the differences between elements and properties within renderable arrays.

Additional resources: