Solved: b2Evolution – Sidebar 2 [NOT INCLUDED IN SELECTED SKIN!]

I’ve just upgraded another blog from b2Evolution 1.10 to 2.4, which means reworking the skin I developed to work with the new “Skins 2.0” framework. It also means that instead of hacking html into my _main.php file, I’m going to use the customisable ‘widgets’ to create my sidebars. This is in the Blog Settings -> Widgets panel.

It seems to work pretty well. I copied a default skin (the asevo one) to a directory called proto, installed the copied skin and began changing it. I decided I wanted to keep the 3-column layout from my old 1.10 skin and luckily there is already a default container called Sidebar and another called Sidebar 2. The problem was my skin didn’t use Sidebar 2.

It was easily fixed, I created a new <div> and used the same skin_container function which the skin used to call the Sidebar widget. I just replaced skin_container( NT_(‘Sidebar’) with skin_container( NT_(‘Sidebar 2’) and it fitted in. Despite the fact the skin now used Sidebar 2, the admin interface kept telling me it didn’t. The container in the admin site said Sidebar 2 [NOT INCLUDED IN SELECTED SKIN!] and every time I tried to add a new widget I got a message saying “WARNING: you are adding to a container that does not seem to be part of the current skin” (I Googled the former error message and, to my shock, got zero results. Hopefully this post will fix that).

Solution

It still worked ok, but I don’t like things that are out of place. To solve this, it turns out all you have to do is go to Global Settings -> Skins install panel and there’s an icon beside each skin to “Reload containers”. Do that and it’ll pick up your call to Sidebar 2 and rid you of that irksome error message.

Author: nerd.

An experienced IT professional, I used to run a number of small websites and spend a lot of time tinkering with my sites or my PC - back when I had free time.

3 thoughts on “Solved: b2Evolution – Sidebar 2 [NOT INCLUDED IN SELECTED SKIN!]”

  1. nice site and nice colors 😉

    do you know how to recover an accidentally deleted sidebar container from b2evo?
    as you mentioned above, i had the same issue, but removed all of the widgets before
    thinking about adding the sidebar. i tried it on another blog and sidebar works but
    on my main blog there is noe more container.. reloading does not help

    help is appreciated

    thanks & cheers phk

  2. Not sure, I didn’t have to restore a deleted one but my skin didn’t include one to start with so I had to add one, maybe the same process?

    The code for the sidebar is:

    skin_container( NT_('Sidebar'), array(
    // The following (optional) params will be used as defaults for widgets included in this container:
    // This will enclose each widget in a block:
    'block_start' => '<div class="evo_side_item $wi_class$">',
    'block_end' => '</div>',
    // This will enclose the title of each widget:
    'block_title_start' => '<h3>',
    'block_title_end' => '</h3>',
    // If a widget displays a list, this will enclose that list:
    'list_start' => '<ul>',
    'list_end' => '</ul>',
    // This will enclose each item in a list:
    'item_start' => '<li>',
    'item_end' => '</li>',
    // This will enclose sub-lists in a list:
    'group_start' => '<ul>',
    'group_end' => '</ul>',
    ) );

    Just replace NT_(‘Sidebar’) with NT_(‘Sidebar 2’) if you want to make use of a second sidebar (this allows you to add widgets to a second sidebar).

    HTH.

Comments are closed.