Customizing block assignment (lists) per node.

thorie79 - July 19, 2007 - 17:48

Hello,

Is there a way to choose different block-to-region assignments per node. For example, if I go to Adminster > Site Building > Blocks, then I will be able to select which blocks I want in which region. But this seems to apply globally to all pages.

I actually want different nodes to have different assignments. For example:

node/1 has the "left-sidebar" region with login, calendar, and notebook modules.
node/2 has the "left-sidebar" region with most recent posts, and who's online modules.

How can I do this in Drupal?

Thanks!
Timmy

Use taxonomy theme, or PHP in page.tpl.php to control position

iDonny - July 19, 2007 - 18:16

Block positions are assigned per-theme. However, there are ways to dynamically change the positions.

1) Leave the blocks targeted to the same regions, and switch the visual position of the region based on some logic
You can use logic within page.tpl.php to determine where and how blocks will be positioned, or in the presentation layer, you can have a common page.tpl.php file and pick a different CSS file to position the blocks as required.

2) Install the Taxonomy theme module, and that will enable you to create different arrangements for each theme selection. The different themes in this case will be the same exact them with different names, and using a taxonomy option, you can assign a certain node, or group of nodes to certain terms to control the block arrangement.

Let me know if you need more help with this or other issues

-----
iDonny Productions: Web CMS Design, Development & Web Standards

I don't think I explained what I am doing clearly...

thorie79 - July 19, 2007 - 18:37

I am not trying to change the positions or theme.

I would like to use a completely different set of modules, in every different node. I can't seem to assign more than one set of modules to the regions using the administer interface. Is there a way to separately define the modules that go into each one of the regions, PER NODE?

By modules - you mean blocks?

jastraat - July 19, 2007 - 19:54

You can specify what individual pages each block displays on. If you click 'configure' on a block (for example Who's Online) you can specify where it should appear under page specific visibility settings. If you only want the block to appear on a specific node, just enter 'node/#' (# being the number of the node you wish it to appear on), and select 'Show on only the listed pages'

------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)

OOooooohhh! I get it now...

thorie79 - July 19, 2007 - 23:30

Thank you!

I didn't know you can assign a different set of modules/blocks -> regions, when I select different themes! That's great! And I can also potentially add all the possible blocks to each of the regions, then turn them on/off per node using the Taxonomy Theme module.

Finally makes sense.

Thanks

multiple regions

mbeenon - May 10, 2009 - 21:11

This sounds like something I am trying to accomplish. Assign a block to multiple regions.
Because that sounds like the only way to have a block appear in one region on a certain page, and have it appear in a different region on another page. Like, having the calendar block show up in the right sidebar on most pages...but having it appear in content-bottom on the calendar page. Is this possible with some sort of module?

Matt Bannon

You may want to look into

jastraat - May 13, 2009 - 21:04

You may want to look into Panels. http://drupal.org/project/panels

------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)

Use MultiBlock module

deepak.cms - May 15, 2009 - 07:18

MultiBlock module can help here, it creates multiple instances of a block. It just creates a copy of the existing block and the copy can be assigned to another region. The module can be downloaded from the following link. http://drupal.org/project/multiblock

 
 

Drupal is a registered trademark of Dries Buytaert.