- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrade from 2.x to 3.x
Upgrade from 2.x to 3.x
Skins Upgrade
b2evolution 2.x skins should work in b2evolution 3.x without modification. (see below if you have issues with the menu bar)
However, if you want to take advantage of all the new features in b2evolution 3.0 you may need to add a few skin tags to your skin.
Note: as of b2evo 3.1.0-beta, not all skins that are packaged with b2evo include the following. This will be fixed in the stable release.
Featured/Intro post
See posts.main.php in the evopress skin for an example.
Note: The following procedure requires a lot of code. We will try to package that into smaller code for the stable release. The following is valid code though.
Locate this section in your *.main.php
skin file:
<?php
// Display message if no post:
display_if_empty();
while( $Item = & mainlist_get_item() )
{ // For each blog post, do everything below up to the closing curly brace "}"
?>
This is where the loop of posts starts.
In order to display featured or intro posts, you need to add the following before the code above, like this:
<?php
// -------------------------- BEGIN FEATURED/INTRO POST ---------------------------
// Go Grab the featured post:
if( $Item = & get_featured_Item() )
{
?>
<div class="featured_post">
<?php
$Item->edit_link( array( // Link to backoffice for editing
'before' => '<div class="floatright">',
'after' => '</div>',
) );
?>
<h2><?php $Item->title(); ?></h2>
<?php
if( $Item->is_featured() )
{ // Featured post, display extra info: (as opposed to intro posts which are also displayed here):
?>
<small>
<?php
$Item->issue_time( array(
'time_format' => 'F jS, Y',
) );
?>
</small>
<?php
}
?>
<?php
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', array(
'image_size' => 'fit-400x320',
'force_more' => true,
) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
?>
<?php
// List all tags attached to this post:
$Item->tags( array(
'before' => '<div class="posttags">'.T_('Tags').': ',
'after' => '</div>',
'separator' => ', ',
) );
?>
<?php
if( $Item->is_featured() )
{ // Featured post, display extra info: (as opposed to intro posts which are also displayed here):
?>
<p class="postmetadata">
<?php
$Item->categories( array(
'before' => T_('Posted in').' ',
'after' => ' ',
'include_main' => true,
'include_other' => true,
'include_external'=> true,
'link_categories' => true,
) );
?>
<?php
$Item->edit_link( array( // Link to backoffice for editing
'before' => ' | ',
'after' => '',
) );
?>
<?php
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'feedbacks',
'link_before' => ' | ',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
'use_popup' => false,
) );
?>
</p>
<?php
}
?>
</div>
<?php
}
// ---------------------------- END FEATURED/INTRO POST ----------------------------
?>
<?php
// Display message if no post:
display_if_empty();
while( $Item = & mainlist_get_item() )
{ // For each blog post, do everything below up to the closing curly brace "}"
?>
What if the new menu bar doesn’t work?
The menu bar is not typically part of the skin so it should work with any skin, including third party skins.
CSS for the menu
The first thing to try is to reload the page several times (until the cache clears) or try on another browser. Most issues only appear the first time you try to load the menu after you upgrade.
If that doesn’t work, it is very likely that the skin you are using is using some dirty CSS tricks (like !important) that tamper with the menu styles.
The CSS styles for the menu are located in /rsc/css/basic.css
Javascript for the menu
The menu is included through the _html_header.inc.php
file. Again, this file is not typically part of a skin. However if your skin requires to have this file, here is what you need to know:
In version 2.x you had this:
global $xmlsrv_url;
require_js( 'functions.js' );
require_js( 'rollovers.js' );
skin_content_header(); // Sets charset!
In version 3.x you should now have:
global $xmlsrv_url;
add_js_for_toolbar(); // Registers all the javascripts needed by the toolbar menu
header_content_type(); // Sets charset!
Note that the menu can work without javascript on most modern browsers. It will just be a little less fancy. So you can try to remove add_js_for_toolbar();
and see what happens.
Removing the menu
If for some reason you decide you’re better off without the evobar menu, comment out add_js_for_toolbar();
as said above and also comment out the following line:
// ---------------------------- TOOLBAR INCLUDED HERE ----------------------------
require $skins_path.'_toolbar.inc.php';
// ------------------------------- END OF TOOLBAR --------------------------------