- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrading to b2evolution version 7.x
Upgrading to b2evolution version 7.x
You can upgrade normally but if you are using custom skins, you will need to take care of a few things in order to take full advantage of b2evolution v7.x.
DB upgrade
Many things will be upgraded and optimized, including charsets. Rewriting your whole DB to UTF-8 MB4 (and ASCII where UTF-8 is not needed) may take several minutes.
Therefore, it may be necessary to click "Continue…" during the upgrade process:
Custom Site Skin
In v7 the site skin is a skin "almost like any other". b2evolution ships with 4 different Site Skins and you can select any of them for your site in Back-Office > Site > Skin. If you had Site Skin enabled in v6, you will get the default site skin in v7 and if you had a custom site skin, the customizations will be ignored until you upgrade them (see below).
The site skins reside in the /skins/
folder like normal skins (because a skin could be both a Site Skin and a Collection Skin – more evolutions to come along these lines).
Conversely:
- If you want to make a custom site skin, you should duplicate an existing site-skin in the
/skins/
folder and modify it. - The files in
/skins_site/custom/
are ignored by b2evolution v7. - You should delete the complete
/skins_site/
folder from your server.
Custom skins
Your custom skins from b2evolution v6 should generally work in v7 but you will not be able to use the Customizer Mode. If you try it on one of your skins, you will see error messages like this:
The cleanest way to proceed with the upgrade is like this:
When you had a container like:
<div class="evo_container evo_container__sidebar">
<?php
// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( NT_('Sidebar 2'), array(
// The following (optional) params will be used as defaults for widgets included in this container:
...
// ----------------------------- END OF "Sidebar" CONTAINER -----------------------------
?>
</div>
Change it to:
<?php
// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
widget_container( 'sidebar_2', array(
// The following (optional) params will be used as defaults for widgets included in this container:
'container_display_if_empty' => false, // If no widget, don't display container at all
...
// ----------------------------- END OF "Sidebar" CONTAINER -----------------------------
?>
Custom Containers
If you pay close attention, you may have noticed above that we changed names like NT_('Sidebar 2')
to codes like 'sidebar_2'
The common containers, such as sidebar
, sidebar_2
, menu
, etc. will be defined by default but if you have more exotic containers, you need to declare them in _skin.class.php
like this:
/**
* Get the container codes of the skin main containers
*
* This should NOT be protected. It should be used INSTEAD of file parsing.
* File parsing should only be used if this function is not defined
*
* @return array Array which overrides default containers; Empty array means to use all default containers.
*/
function get_declared_containers()
{
// Array to override default containers from function get_skin_default_containers():
// - Key is widget container code;
// - Value: array( 0 - container name, 1 - container order ),
// NULL - means don't use the container, WARNING: it(only empty/without widgets) will be deleted from DB on changing of collection skin or on reload container definitions.
return array(
'front_page_secondary_area' => NULL,
'item_single_header' => NULL,
'chapter_main_area' => array( NT_('Chapter Main Area'), 46 ),
'sidebar_single' => array( NT_('Sidebar Single'), 95 ),
);
}
API version
Once your skin is upgraded to v7, signal it here:
/**
* What evoSkins API does has this skin been designed with?
*
* This determines where we get the fallback templates from (skins_fallback_v*)
* (allows to use new markup in new b2evolution versions)
*/
function get_api_version()
{
return 7;
}