drupaldrupal-blocksdrupal-regions

Assign a block to more than 1 region


How do I assign a block (the very same block) twice or thrice to different regions? The idea is not to have the same block on the same page more than once, but in different locations on different pages, so four 'displays' would be available:

Where it should be located, should be as simple as adding node paths in the textare, right? I understand that's what it's for...

If it's a module (please god no, not another module!), I'd like a few details.

Thanks.


Solution

  • You'll want to look into the Context module, which will let you assign blocks based on sets of conditions. You create a context, set up a couple of conditions, then create a reaction to those conditions where your block appears.

    So, let's say you wanted to show Block X on the front page and when a user is logged in. When it's the front page Block X is in Region 1, but when the user is logged in, Block X is in Region 2.

    You'd create two contexts:

    1. Conditions: Is Front Page, User is anonymous, Reactions: Show Block X in Region 1
    2. Conditions: User is logged in, Reactions Show Block X in Region 2

    I'm generalizing here, but you'll see what conditions and reactions are available for use when you install Context.