Evoskin and a template
From b2evolution manual
m (introducing templates) |
(→Including a calendar) |
||
| Line 29: | Line 29: | ||
</form></code> | </form></code> | ||
| - | |||
| - | |||
===Including another blog to act as a blogroll=== | ===Including another blog to act as a blogroll=== | ||
Revision as of 04:28, 11 January 2007
Contents |
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 "Customize your blog" section on the Main Page for more information about changing skins and templates.
Main template
This man page refers to b2evolution version: 0.8.2-RC2
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"); ?>
<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 consider displaying this logo: http://b2evolution.net/img/xml.gif (/blogs/img/xml.gif) next to these links so readers can easily identify the XML RSS feeds.
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.
