Hello,

New to Drupal. Can't seem to understand how the blocks and regions work.

I am using the Quote module and set up a new block for quotes. I assigned the block to the left sidebar region. However, the block keeps showing up in the center content region.

Here is what I can't understand - How does Drupal know where the left-sidebar region is or where the right-sidebar region is. Do I need to follow some CSS naming conventions when I define the which "div" is for the left-sidebar region?

Thanks in advance!

Comments

vm’s picture

regions are defined in the themes .info file
laid out in page.tpl.php
and styled in style.css

t-wins’s picture

My question is - how does drupal know which section of page.tpl.php is for regions[left] = Left sidebar or regions[right] = Right sidebar?

When drupal parse the page.tpl.php file, does it look for some IDs in the CSS or something that tells it where the left sidebar region starts and where it ends?

Thanks!

zbricoleur’s picture

Look at page.tpl.php. You will see, somewhere (for any theme that actually uses the left sidebar), something like this:

<?php print $left ?>

That is the left sidebar. Whatever blocks you've put in the left sidebar will print out right there.

regions[left] = Left sidebar <-- In these lines in the info file, whatever is in the square brackets will become the name of the variable that you have to print out in the page.tpl.php file in order to produce that region there. If for some reason there is no print statement for that variable in the page.tpl.php file, the region will not show up (though it will still show up as available on the blocks page). Whatever is to the right of the equal sign will be the name of the region as it appears on the blocks page.

vm’s picture

yes, as this is where the regions are laid out, in page.tpl.php

you have div ids and classes

depending on how the theme is developed. You've metioned a theme so it's difficult to be theme specific in this case. however looking at your page.tpl.php will provde fruitful.

where a region starts and ends? I'm not sure I grasp, however, if you mean in size? that's handled with css

t-wins’s picture

Thank you both for the great help! It makes a lot more sense now.