Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Placing Panels in Blocks with Mini Panels

Video loading...

  • 0:00
  • 0:05
    with Mini Panels with Amber Matz
  • 0:07
    AMBER MATZ: With panels, you can place blocks and panel regions.
  • 0:11
    With mini panels, you can place panels and block regions.
  • 0:15
    It's only fair, right?
  • 0:16
    While it's true that most things are cuter in miniature,
  • 0:19
    unless you're building panels of puppies,
  • 0:21
    mini panels isn't really the cute alternative
  • 0:24
    to panels, just a more portable version.
  • 0:27
    Mini panels enables you to create a portable panels component that
  • 0:31
    can utilize layouts, use context, and add content to panels that may
  • 0:35
    then be placed in block regions using
  • 0:37
    the block administration page.
  • 0:39
    It can even be used to build mega menus using the menu mini panels
  • 0:44
    module, which I will not be covering in this lesson
  • 0:46
    due to problematic alliteration issues.
  • 0:49
    However, in this lesson, we will build
  • 0:51
    and enhanced footer region containing three menus and three
  • 0:55
    columns using mini panels and the block administration page.
  • 0:59
    By the end of this lesson, you'll be on your way
  • 1:01
    to creating simply adorable mini panels that
  • 1:04
    can be placed as blocks on your Drupal site.
  • 1:09
    On my site, I want to add a panel to my footer region that contains
  • 1:13
    three columns with a navigation, user
  • 1:16
    menu, and main menu contained in each column.
  • 1:20
    But so far in panels, I've only been able to add
  • 1:23
    panels to the main content region.
  • 1:25
    So how do I add panels to the content region?
  • 1:29
    Well, I could do that using mini panels.
  • 1:31
    So I'll go ahead and enable mini panels.
  • 1:34
    I've already downloaded the panels package and mini panels is
  • 1:38
    one of the modules contained in panels.
  • 1:40
    So I'll enable that here and click Save Configuration.
  • 1:45
    Now I can go to Structure, Mini Panels,
  • 1:48
    and this is where I can administrate my mini panels.
  • 1:51
    I can add, edit, or delete them.
  • 1:53
    So first, I'm going to add a mini panel
  • 1:55
    by clicking on the Add button.
  • 1:58
    I'll give it an administrative title of footer menus.
  • 2:01
    This is going to give it a machine name and a regular title.
  • 2:05
    And I'll give it an administrative description for my future self
  • 2:09
    or anyone else that's administrating the site.
  • 2:12
    Navigation user and main menus in a three column mini panel.
  • 2:16
    I'll leave this category blank.
  • 2:18
    It's going to default to mini panels.
  • 2:20
    But if you're creating a host of mini panels,
  • 2:22
    this is a great way to keep things organized.
  • 2:25
    I'll click Continue.
  • 2:27
    And I don't have any contacts or relationships I need to add,
  • 2:31
    because I'm just dropping in menus.
  • 2:33
    So I'll click Continue.
  • 2:34
    And now I can choose my three column layout
  • 2:37
    by selecting the columns three category and then
  • 2:40
    this three column layout here.
  • 2:43
    I'll click Continue.
  • 2:44
    And now this should look quite familiar
  • 2:46
    if you've been playing around with panels at all.
  • 2:48
    I've got my three regions with a gear
  • 2:51
    in each corner where I can add content.
  • 2:53
    So I'll start with the left side.
  • 2:55
    And I'll click the gear, then Add Content.
  • 2:59
    I'll go into Menus.
  • 3:00
    And first I'll add my navigation menu.
  • 3:03
    I clicked on that, and I can override
  • 3:05
    the title here if I wished.
  • 3:07
    I could use keywords from contexts, or I can use the title to contain
  • 3:12
    the original title, or I can display no title at all by checking
  • 3:16
    Override Title then using the Drupal keyword none with angle brackets
  • 3:20
    surrounding it.
  • 3:22
    But I'm just going to leave this as is and click Finish.
  • 3:26
    Next, I'll go into the middle column, click the gear,
  • 3:29
    then Add Content.
  • 3:31
    Go back into Menus, and now I want to add
  • 3:34
    the user menu to that middle column.
  • 3:36
    So now I'll click Finish.
  • 3:37
    And finally, on the right side I'll Add Content.
  • 3:41
    Go back into Menus, and I'll add my main menu, then Finish.
  • 3:46
    I'll click on the Preview button to see how my content looks.
  • 3:50
    And if I needed to make any other changes,
  • 3:53
    if I wanted to change these content pane titles,
  • 3:55
    I could go back in to my content pane by clicking the gear then
  • 4:00
    settings, and I could override the title.
  • 4:03
    But I'm going to call this good.
  • 4:05
    So I'll click Finish.
  • 4:06
    Now I can go back in, I can edit, disable, delete,
  • 4:11
    clone, or export this mini panel.
  • 4:13
    But what I'd really like to do is add this to my footer region
  • 4:16
    right now.
  • 4:17
    So I'm going to go over to the block administration page,
  • 4:20
    and I can get to that through the Admin menu
  • 4:22
    by clicking Structure, Blocks.
  • 4:25
    And this should look pretty familiar.
  • 4:27
    If you've used blocks at all, under disable blocks,
  • 4:30
    I've got my mini panel of footer menus.
  • 4:32
    I can drag this up to the footer, or I
  • 4:35
    could have selected it from the drop down menu.
  • 4:39
    And now I'll click Save.
  • 4:43
    I can administrate the visibility settings
  • 4:46
    just as I would a regular block by clicking the Configure button.
  • 4:50
    But first, let's see if this worked.
  • 4:52
    Let's head over to the home page, scroll down, and now in my footer
  • 4:56
    region, I've got a three column panel containing
  • 5:00
    the navigation, user, and main menus.
  • 5:04
    If I want to edit this mini panel, I can
  • 5:06
    do it in several different ways.
  • 5:08
    I can hover over the mini panel and go to the Configure block length
  • 5:14
    that appears in the contextual menu.
  • 5:16
    Then I could modify any of the block visibility settings or region
  • 5:20
    settings, or this new link appears-- Manage This Mini Panel.
  • 5:24
    So I can click on that.
  • 5:26
    And this navigation is not a linear wizard as it may appear to be.
  • 5:31
    I can jump around to any section by clicking on these links.
  • 5:36
    So I can jump over to content or back to context
  • 5:39
    if I wanted to add a context setting.
  • 5:42
    So I don't need to proceed through this settings contacts layout
  • 5:47
    content by using any of these Submit buttons.
  • 5:49
    I can just jump around as needed.
  • 5:52
    So here, I could add more content.
  • 5:55
    I could modify the settings of these panels, whatever I needed to do.
  • 6:01
    If I wanted to export this mini panel,
  • 6:05
    I could click on the Export tab, select all, copy this, and paste it
  • 6:11
    into another site or wherever I needed to import this mini panel.
  • 6:17
    So using the mini panels module, you can create a panels layout
  • 6:21
    with unique layout or content, and you can drop that
  • 6:25
    into any region available in your theme.
  • 6:27
    For our purposes here, I created a mini panel with a three column
  • 6:32
    layout and I dropped in the navigation,
  • 6:34
    user menu, and main menu.
  • 6:36
    Then I used the block administration page
  • 6:38
    to move that mini panel into the footer region.
  • 6:42
    I can configure visibility settings just as I would a normal block,
  • 6:46
    or I can manage the mini panel by going back into the footer menus
  • 6:52
    mini panel and clicking on any of these sections that I need to edit.
  • 6:57
    I can change the layout or content, or I can export the mini panel.
  • 7:03
    So that's how you can use mini panels
  • 7:05
    to drop in panels to any region in your theme.
  • 7:09
    Drupalize Me

Placing Panels in Blocks with Mini Panels


With mini-panels, you can build portable panels components and place them as blocks in regions of your theme.

In this lesson...

  • Build a 3-column mini-panel
  • Place a menu in each column
  • Place the mini-panel in the footer region as a block

By the end of this lesson, you will be able to build a mini-panel and understand how to place it in a region using the block administration page.

Demo site log in:

  • Navigate to /user
  • Login with admin/admin
Log in or sign up to download companion files.
Additional resources: