Skip to content
agiledrop logo
    • Agencies
    • Organizations
    • Product teams
    • E-learning
    • Media & publishing
    • Staff augmentation

    • Dedicated teams

    • Turn-key projects

    • Drupal

    • Laravel

    • Moodle

    • Storyblok

    Front-end

    • React
    • Next.js
    • Vue
    • Nuxt.js
    • Angular

    Back-end

    • PHP
    • Laravel
    • Symfony
    • Node.js
    • Company
    • History
    • Team
    • Careers
    • Slovenia
    • Blog
    • Podcast
Get developers
Footer Agiledrop logo
Agiledrop Ltd.Stegne 11aSI-1000 LjubljanaSlovenia, EUEU flag
gold creditworthiness
Services
  • Support & maintenance
  • Drupal 7 upgrade
  • PHP staffing
  • JavaScript staffing
  • Legacy PHP development
About
  • Company
  • History
  • Team
  • Careers
  • Slovenia
  • Brand materials
Contact us
  • Email:
    [email protected]
  • Phone:
    +386 590 18180
© 2013-2023 AGILEDROP Ltd
  • Privacy policy
  • Terms of service
  • Cookie policy

Context Groups

Context Groups image

Igor

Posted on28 Feb 2017in

When starting a new Drupal project, you have to decide, how you will handle a block layout. If you can’t achieve the desired layout with Drupal core block layout, you will probably choose Context or Panels module for handling a layout. If you chose Context over Panels, this blog post will help you build more complex layouts with context.

Almost anyone, who used Context module, had a case, where they wanted to place two, three or more blocks next to each other and maybe one block below as it is shown in the picture bellow.

You probably managed that by creating a new region for the top three blocks or maybe you created a new custom block, which was built with those three block inside, and then added this custom block into context.

The module Context groups solves this problem by creating groups to your reaction in context. It creates a wrapper for your blocks. Moreover, you can also add classes to the groups, to make styling on front-end easier. Let’s see the module in action.

First, let’s download and enable the module. On the configuration page of your context, you should now see Add group button next to »Place block«.

When you click on it, a popup will appear, where you can enter a group name, classes and select a region, where you want to place your group. With the click on the “Add group” button, the group should be displayed in selected region.

With adding multiple groups you can create a completely customised layout to suit your needs and design. You can even nest the group, enabling you to have unlimited ways to build complex layouts.

Since groups are rendered through theme function there is also a possibility to change the way context groups are rendered with overriding the template. Just use one of the next template suggestions:

•	context-groups.html.twig
•	context-groups--{context_id}.html.twig
•	context-groups--{context_group_name}.html.twig
•	context-groups--{context_id}--{context_group_name}.html.twig

Related blog posts

Blog post card background image.

How Agiledrop supports the Laravel community

Published On 18 Jun 2025  in Company, Community, Laravel 
Blog post card background image.

How we support the local development community

Published On 16 Jun 2025  in Company, Development, Community 
Blog post card background image.

Top Drupal blog posts from May 2025

Published On 12 Jun 2025  in Drupal