I am trying to output a block onto my page without making it show up in the left or right sidebar? Is there some type of way I can insert a block by id or something?

Thanks!

Comments

chromeyellow’s picture

Yes, in fact you have several choices. Depends whether you have one specific block you want in the content area, or you want all the blocks in the middle and no sidebar at all.

First, check out this page from the php snippets section of the handbook - "How to place contents of a block anywhere". Explains in simple steps how to put a specific block in the main content area, and as you guessed it involves the block's id. http://drupal.org/node/26502

Second, if you're using a phptemplate theme, the blocks are output in the page.tpl.php file by the php statement that goes something like this: print $sidebar_left . Now, normally this statement will appear in the html code for "left-sidebar" but you can easily experiment with putting it anywhere you want - ie, inside the 'main' or 'content' div. The initial results will be wonky but you can clean it all up with css tweaking.

Third - download the great new 4.7 beta which includes three new areas for blocks!

slayerment’s picture

Awesome. That worked perfect! :)