b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. Creating evoSkins
  5. How to upgrade a b2evo blog template to an evoSkin

How to upgrade a b2evo blog template to an evoSkin

This man page refers to b2evolution version: 0.8.2-RC2

This explains how to make an evoSkin out of a regular blog template. Of course, you could also start from scratch by editing the custom skin.

The idea is to customize the custom skin by using your previous b2 template.

Here's how to proceed:

  1. Go the the /skins/custom directory
  1. Rename _main.php to _bak_main.php (you want to keep this handy for future reference).
  1. Copy your previous template (index.php, b2.php, myblog.php or whatever) and rename it to _main.php.

Pay attention: you must copy the file, not move it! We will actually split the contents of your blog template into two files!

  1. The original file is to become a simple stub, setting a few parameteres and then letting b2evolution call the desired skin.

Delete the template code from this file in order to just keep the beginning of the file like this:

<?php
/*
* This file is a stub for displaying a blog, using evoSkins.
* This file will fix some display parameters and then let b2evolution handle
* the display by calling an evoSkin. (skins are in the /skins folder.)
*/

# First, select which blog you want to display here!
# You can find thess numbers in the back-office under the Blogs section.
# You can also create new blogs over there. If you do, duplicate this file for the new blog.
$blog = 2; // 2 is for "demo blog A" or your upgraded blog (depends on your install)

# Now, select the default skin you want to display for this blog.
# This setting refers to a subfolder name in the '/skins' folder
$default_skin = 'custom';
# You can *force* a skin with this setting:
# $skin = 'custom';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = "'published'";

# This is the blog to be used as a blogroll (set to 0 if you don't want to use this feature)
$blogroll_blog = 4;

# This is the list of categories to restrict the blogroll to (cats will be displayed recursively)
# Example: $blogroll_cat = '4,6,7';
$blogroll_cat = '';

# This is the array if categories to restrict the blogroll to (non recursive)
# Example: $blogroll_catsel = array( 4, 6, 7 );
$blogroll_catsel = array( );

# Here you can set a limit before which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the past
$timestamp_min = '';

# Here you can set a limit after which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the future
$timestamp_max = 'now';

# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...

# That's it, now let b2evolution do the rest! :)
include(dirname(&#x5f;_FILE__)."/b2evocore/_blog_main.php");
?> 
  • *Attention please:** You need to remove your current $skin=''; and set the default skin to custom.
  1. The new file (_main.php in the custom skin folder), on the other hand, is to become a template usable by all blogs. So you need to delete the parametering from the top of this file.

Your _main.php should actually start directly like a regular HTML/XHTML page:

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<base href="<?php skinbase(); // Base URL for this skin. You need this to fix relative links! ?>" />
<title>... 
  1. Make sure you have a <base> tag in your <head> section; right after the <head> tag is best. See above.
  1. You may also want to add more features to your main template.
Created by fplanque • Last edit by fplanque on 2015-07-20 11:44 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Loading additional resources into a skin
      • Where are the skin files?
      • CSS Guidelines
      • Targeted CSS Selectors
      • Introducing evoSkins
      • Modifying evoSkins
      • Creating evoSkins
        • How to upgrade a b2evo blog template to an evoSkin
        • Skin Checklist
        • Validate as XHTML
        • Wordpress to b2evolution tags
      • Skin Tags / API
      • Styling widgets
      • Skin Quality Control
      • Using HTML 5 tags
      • Using Custom Item Templates
      • Using bootstrap classes in footers
      • Using Grunt
      • Dev Menu
      • How to add a Google Font (WebFont) ?
      • Custom Fields in a Template
      • Site Skins
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque