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.
Here are possible values for
- 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 : 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.
At the very least, a skin folder like
/skins/myskin2 must contain a main template file named
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
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.
If no main template has been found for a specific display, 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.
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 directory will be used (in this case,
/skins/_msgform.disp.php would be used).
The main and disp templates above may in turn call include files (
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 directory will be used (here
/skins/_html_header.inc.php) would be used.
Created by • Last edit by on Oct 08, 2015
Feedback awaiting moderation
This post has 1 feedback awaiting moderation...
Form is loading...