Creating a new context is quite easy. Here we're going to create a sample context that displays a block on all the nodes that have working-structure within its path.

Click on an image to make it bigger.
Context Module - Create New Context - Click Add Button

1. Add New Context

Go to Admin menu > Structure > Context > Add.

Once on the Context Management screen, you'll see a list of all of the different available contexts on the site.

To add a new context, click the Add button.

Context Module - Create New Context - Fill Out Administrative Info

2. Fill Out Administrative Information

A new screen will appear.

Name field = Add a name for your context. Keep the characters lowercase. Separate words with dashes.

Tag field = Add a tag field, if desired. This will group and sort your context on the management screen.

Description field = Add text that describes why this context exists.

Context Module - Create New Context - Select Path Condition

3. Add a Condition

Now, let's add a condition.

Conditions field = Path

Context Module - Create New Context - Add Path(s)

4. Add a Path

You'll want to make sure that you have the correct path. Remember, the path is everything after the base URL. In our OSU Drupal 7 distribution, the base URL ends after the edu. Our example path is fairly deep down in the URL structure, as shown below.

So, according to our example, we need everything both before and after the working-structure part of the URL path. To do this, we'll use an asterik (*) wildcard both before and after the working-structure path segment.

We'll add a couple of things in the Path field:

  • */working-structure (show layout on node that has a URL address that ends with working-structure path segment)
  • */working-structure/* (show layout on all nodes that have working-structure within its path)
Context Module - Create New Context - Select Block Reaction

5. Add a Reaction

Now we need to add a reaction.

Reactions field = Blocks

Context Module - Create New Context - Select Block Reaction

6. Select Block

When the block map on the right appears:

Content region = Main page content block (from the System fieldset)

Primary sidebar region = Custom Drupal Structure block (from the Block fieldset)

Click the Save button.

Context Module - Create New Context - Block Shows On Path

7. Completed

The custom block will now show on all pages that have working-structure in their URL paths.