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. Introducing evoSkins
  5. evoSkin Structure

evoSkin Structure

evoSkins are basically collections of template files inside of a skin folder.

This is the organization of templates inside a skin folder.

What template is called by b2evolution?

b2evolution chooses which template to display based on the "payload" requested by the user/web browser through the URL of the current page. Internally, the "payload" type is identified by the variable $disp (which you can regard as meaning "display" or "dispatch", whichever makes more sense to you).

In some situations you can also see URLs containing a param string like ?disp=users. In this case we specifically request the "users" template. In other cases, the $disp is inferred by the URL; this is notably the case with permalinks for posts which resolve to $disp='single' by default.

Learn more: Disp Reference.

$disp meaning

Here are possible values for $disp:

  • disp = arcdir : archives directory
  • disp = catdir : category directory
  • disp = comments : latest comments
  • disp = mediaidx: media files index
  • disp = msgform : form to send a message
  • disp=page : displays an Item of type "page"
  • disp = posts (List of Posts / Items) : displays the Items/Posts of a collection, filtered or not with additional params
  • disp = single : displays an Item of type "post" (or other custom type)
  • See more in: Disp Reference.

Main templates

At the very least, a skin folder like /skins/myskin2 must contain a main template file named index.main.php.

Depending on what b2evo wants to display, it will call a specific "top level" a.k.a. "main" template (*.main.php) within the skin folder. If the sought template is not found, b2evo will fall back to the default index.main.php.

evoSkin Structure

Fallback to the main template

As previously said, if the sought template is not found, b2evo will fall back to the default index.main.php template. Thus, the main template is really the only mandatory template for a simple skin.

Many skins only have one main template.

Disp templates

If no main template has been found for a specific $disp, the default index.main.php will be called. That template will generally include a call to skin_include( ‘$disp$’, … ) which will in turn include a "level 2" a.k.a. "disp" template.

evoSkin Structure

Fallback to factory templates

If a specific disp template is not found within the skin directory (for example, if /skins/myskin2/_msgform.disp.php is not found), then the default disp template from the /skins/fallback_v* directory will be used (in this case, /skins/fallback_v6/_msgform.disp.php would be used).

Include files

The main and disp templates above may in turn call include files (*.inc.php).

For example, many skins will use a common header and footer for all their templates. These should be in include files named like this:

  • _html_header.inc.php (contains INvisible common headers, typically the <head> section of the HTML pages)
  • _body_header.inc.php (contains VISIBLE common headers, typically the top blog banner)
  • _body_footer.inc.php (contains VISIBLE common footers, typically the bottom credits)
  • _html_footer.inc.php (contains INvisible common footers, typically logging and debugging code)

Fallback to factory includes

If a specific include file is not found within the skin directory (for example /skins/myskin2/_html_header.inc.php is not found), then the default include from the /skins/fallback_v* directory will be used (here /skins/fallback_v6/_html_header.inc.php) would be used.

Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:24 • •

No feedback yet

On this page

  • What template is called by b2evolution?
  • $disp meaning
  • Main templates
  • Fallback to the main template
  • Disp templates
  • Fallback to factory templates
  • Include files
  • Fallback to factory includes

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
        • evoSkin Structure
        • Introducing evoSkins
        • Working With Skins
      • 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
b2evo

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