- b2evolution CMS User Manual
- Archives
- Evoskin and A Template
Evoskin and A Template
The following refers to b2evolution version: 0.8.2-RC2 and is obsolete. See 2.0.
What’s the difference between an evoskin and a template?
- An evoskin is actually a collection of templates and subtemplates which control the layout of your blog. Skins are the easiest way to customize your blog because they are already packaged for use.
- A template is the page b2evolution uses to include the various aspects of your weblog (posts, comments, category lists, calendar, etc.). You can add or subtract template elements from your blog as you see fit. See below for further information about the various parts of a template.
Generally speaking, b2evo users don’t refer to templates very often. Most customizations are done on the skin level. Please view the Page#Customize & Extend your blog | "Customize & Extend your blog" section on the Main Page for more information about changing skins and templates.
- Introducing Templates
Main template
If you are using evoSkins, the main template is the _main.php file of your skin.
If you are not using skins, the main template is your blog template as you have always known it ;-)
Below are some "tags" you can include in your main template. You can copy/paste from this page.
Creating links to archives
<?php include( dirname(__FILE__)."/_archives.php"); ?>
Creating links to categories
Including a form to select specific categories
<form action="<?php bloginfo('blogurl', 'raw') ?>" method="get">
<?php include( dirname(__FILE__)."/_categories.php"); ?>
<br />
<input type="submit" value="Get selection" />
</form>
Including another blog to act as a blogroll
<?php include( dirname(__FILE__)."/_blogroll.php"); ?>
Including a skin switcher
<ul>
<?php
for( skin_list_start(); skin_list_next(); ) { ?>
<li><a href="<?php skin_change_url() ?>"><?php skin_list_iteminfo( 'name', 'htmlbody' ) ?></a></li>
<?php } ?>
</ul>
Creating links to RSS feeds
<ul>
<li><a href="<?php bloginfo('rss_url', 'raw'); ?>">RSS 0.92 (Userland)</a></li>
<li><a href="<?php bloginfo('rdf_url', 'raw'); ?>">RSS 1.0 (RDF)</a></li>
<li><a href="<?php bloginfo('rss2_url', 'raw'); ?>">RSS 2.0 (Userland)</a></li>
</ul>
Please add a link to the b2evolution home page
<p class="center">powered by<br />
<a href="http://b2evolution.net/" title="b2evolution home"><img src="../../img/b2evolution_button.png" alt="b2evolution" width="80" height="15" border="0" class="middle" /></a></p>
If you are not using skins, you may have to adapt the path to the b2evolution button: http://b2evolution.net/img/b2evolution_button.png (/blogs/img/b2evolution_button.png)
Warning: If you have enabled pings to b2evolution.net, and you do not link to http://b2evolution.net in your blog, you will be banned from further pings.
Including a list of available blogs
<?php
for( $curr_blog_ID=blog_list_start('stub');
$curr_blog_ID!=false;
$curr_blog_ID=blog_list_next('stub') )
{ # by uncommenting the following lines you can hide some blogs
// if( $curr_blog_ID == 1 ) continue; # Hide blog 1...
// if( $curr_blog_ID == 2 ) continue; # Hide blog 2...
if( $curr_blog_ID == $blog ) { // This is the blog being displayed on this page ?>
<a href="<?php blog_list_iteminfo('blogurl', 'raw') ?>" class="BlogButtonCurr"><?php blog_list_iteminfo('shortname', 'htmlbody') ?></a>
<?php } else { // This is another blog ?>
<a href="<?php blog_list_iteminfo('blogurl') ?>" class="BlogButton"><?php blog_list_iteminfo('shortname', 'htmlbody') ?></a>
<?php } // End of testing which blog is being displayed
} ?>
Logging A Hit
Add this, near the end (or at the end) of your template:
<?php log_hit(); // log the hit on this page ?>
You will NEED to log a hit to the page for your stats to work.
Most skins include this in the end of the page.
Recent referrers, search referrers and other stats will not work without this.
2 comments
Comment from: fplanque
Please note this is an obsolete/archived page.
Creating links to RSS feeds: http://b2evolution.net/img/xml.gif not found.
Please add a link to the b2evolution home page: snippet is incorrect, image path should be ../../rsc/img/b2evolution_button.png. You could help us all by creating a "Powered By" widget, then we’ll all say whatever you want!