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. Skin Quality Control

Skin Quality Control

When you develop a new skin, you should check that it matches a set of standards so that it will work effectively in a variety of situations, for a variety of users and so that it is as much future poof as possible (best compatibility with future versions of b2evolution).

Use the latest evoSkins API

If you start by duplicating one of the new Bootstrap skins or by forking the Starter Skin on GitHub, you’ll get this behavior automatically.

If you started another way, check that your _skin.class.php file contains a function like this:


	/**
	 * 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 6;
	}

Currently the latest version is v6.

Using this allows you to automatically use newer & cleaner fallback templates.

We’re using multiple API versions so that older skins can continue to work even when newer features are added or when new CSS classes replace old ones (which is the case when using Bootstrap compared to legacy skins.)

Use responsive design

All new skins should be responsive and display well on a variety of screen sizes, including mobile phones in portrait mode (320 pixels wide!!)

Again, if you start by duplicating one of the new Bootstrap skins or by forking the Starter Skin on GitHub, you’ll get this behavior automatically.

One very important aspect of responsive web design (RWD) is using the correct viewport tag.

You can achieve this by passing this param to the HTML header template:


// -------------------------- HTML HEADER INCLUDED HERE --------------------------
skin_include( '_html_header.inc.php', array(
	'viewport_tag' => '#responsive#' ) );
// -------------------------------- END OF HEADER --------------------------------

You could pass the exact viewport tag you want here but #responsive# is a shortcut to give you automatically the perfect viewport for RWD which is:

<meta name="viewport" content="width=device-width, initial-scale=1">

All new b2evolution skins should use #responsive#.

Again, if you’re using API v6, you don’t even need to do this, it’s the default.

Use Bootstrap

All new b2evolution skins (v6+) are based on Bootstrap and on some additional CSS classes designed of work with Bootstrap.

Any new skin you develop should use these classes as much as possible (of course you can override what you need, but you should use the base classes).

To ensure you use correct classes, always start a new skin by duplicating one of the default skins provided by the latest version of b2evolution. In this case development or alpha versions are the best versions to use. You can also fork the this skin on GitHub (we update it regularly to the latest specs): https://github.com/b2evolution/starter_skin

These skins fail to use the Bootstrap styles:

Skin Quality Control
Skin Quality Control

This skin uses Bootstrap styles but it overrides them too broadly:

Skin Quality Control

Every skin designer makes this exact same mistake! Make your CSS selectors more specific so they don’t change stuff they shouldn’t change.

This skin correctly uses Bootstrap styles:

Skin Quality Control

Use LESS and compile with Grunt

For more information on grunt, see: Using Grunt.

If your skin doesn’t have a Gruntfile.js yet, start by cloning the repository https://github.com/b2evolution/starter_skin , then copy the following files over to each your own skin:

  • .gitignore
  • Gruntfile.js
  • package.json

Then, in a Terminal/Command Line window:

  • cd to your skin folder
  • type npm install at least once
  • every time you edit your .less file type grunt
  • alternatively, type grunt watch so your LESS file will compile automatically every time you save it.

Avoid common CSS mistakes

It is absolutely depressing to see UL lists that don’t nest. Make sure all your lists can support multiple levels:

Skin Quality Control

Test many widgets in your containers

We are preparing a list of which widgets should be tested in which containers.

We are planning to add a feature to b2evolution that will automatically install all the widgets you should use for testing. This will overload your skin and make it look way to busy but it will be very convenient for testing.

_html_header.inc.php

Try to NOT override this file! It is normally possible to customize everything you need by

  • passing params through an array()
  • declaring CSS and JS files to include in _skin.class.php

Use HTML5 tags whenever possible

See: Using HTML 5 tags

(This page is work in progress)

Created by fplanque • Last edit by fplanque on 2016-01-24 00:19 • •

No feedback yet

On this page

  • Use the latest evoSkins API
  • Use responsive design
  • Use Bootstrap
  • These skins fail to use the Bootstrap styles:
  • This skin uses Bootstrap styles but it overrides them too broadly:
  • This skin correctly uses Bootstrap styles:
  • Use LESS and compile with Grunt
  • Avoid common CSS mistakes
  • Test many widgets in your containers
  • _html_header.inc.php
  • Use HTML5 tags whenever possible

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
      • 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
Open-Source 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