b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Demo
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manual Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Website Skins/Themes
  4. Skin Tags / API
  5. Template Tags

Template Tags

This page describes the functions used within a skin template (v 2.x) in order to inject the dynamic data into your blog design.

Below is a listing of available template tags linking to a more detailed explanation for each of them. You will find getting started instructions further down on this page.

Available template tags

  • app_version();
  • blog_home_link();
  • comment_allowed_tags();
  • $Blog->name();
  • $Blog->contact_link();
  • $Blog->footer_text();
  • $Blog->longdesc();
  • $Blog->tagline();
  • credits();
  • display_if_empty();
  • locale_charset();
  • locale_lang();
  • item_prevnext_links();
  • $Item->anchor();
  • $Item->author();
  • $Item->permanent_link();
  • $Item->permanent_url();
  • $Item->can_comment();
  • $Item->can_rate();
  • $Item->can_receive_pings();
  • $Item->categories();
  • $Item->content_teaser();
  • $Item->deadline_date();
  • $Item->deadline_time();
  • $Item->deprecate_link();
  • $Item->edit_link();
  • $Item->extra_status();
  • $Item->has_feedback();
  • $Item->feedback_link();
  • $Item->feedback_feed_link();
  • $Item->feedback_moderation();
  • $Item->files();
  • $Item->locale_flag();
  • $Item->footer();
  • $Item->images();
  • $Item->issue_date();
  • $Item->lang();
  • $Item->language();
  • $Item->locale();
  • $Item->locale_temp_switch();
  • $Item->main_category();
  • $Item->mod_date();
  • $Item->mod_time();
  • $Item->more_link();
  • $Item->msgform_link();
  • $Item->msgform_link_assigned();
  • $Item->priority();
  • $Item->publish_link();
  • $Item->status();
  • $Item->status_raw();
  • $Item->tags();
  • $Item->trackback_rdf();
  • $Item->trackback_url();
  • $Item->issue_time();
  • $Item->title();
  • $Item->type();
  • $Item->views();
  • $Item->wordcount();
  • $Skin->get_path();
  • $Skin->get_url();
  • locale_restore_previous();
  • $Mainlist->page_links();
  • messages();
  • $plugins->call_by_code();
  • powered_by();
  • request_title()
  • skin_include(); *See below
  • skin_container();
  • user_login_link();
  • user_logout_link();
  • user_register_link();
  • user_profile_link();
  • user_subs_link();
  • is_logged_in();

Includes

The skin_include() template tag will include another template. Many of these templates can take parameters too:

  • skin_include( ‘_html_header.inc.php’ …
  • skin_include( ‘_item_content.inc.php’ …
  • skin_include( ‘_item_feedback.inc.php’ …
  • skin_include( ‘$disp$’ …
  • skin_include( ‘_html_footer.inc.php’ …

Other template functions you might encounter

  • skin_init();
  • mainlist_get_item();
  • while( $Item = & mainlist_get_item() ) {

A sample template tag

This is the template tag that displays the date of a post:

PHP

<?php
  $Item->issue_date( array(
      'before'      => '<span class="timestamp">',
      'after'       => '</span>',
    ) );
?>

In the instance above, the template tag has 2 parameters ‘before’ and ‘after’. The HTML snippets that have been specified there will be added before and after the date.

You generally don’t have to pass any parameters at all if you don’t want to. In this case, default parameters will be used. With no parameters, the template tag would look like this:

PHP

<?php
  $Item->issue_date( array(
    ) );
?>

Or it could be trimmed down even further, like this:

PHP

<?php
  $Item->issue_date();
?>

On the contrary, you can also add parameters. For example, you could specify the date format to use, like this:

PHP

<?php
  $Item->issue_date( array(
      'before'      => '<span class="timestamp">',
      'after'       => '</span>',
      'date_format' => 'Y-m-d',
    ) );
?>

Created by fatimahnasra • Last edit by fplanque on Mar 27, 2018

No feedback yet


Form is loading...

Comment feed for this post

Search

  • b2evolution CMS User Manual
  • Introduction
  • Installation / Upgrade
  • User's Guide
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • Photo Gallery Anatomy
      • 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
        • Template functions
        • Template Tags
        • Tag Item Priority
        • Tag Item Trackback RDF
        • Tag Item Title
        • Tag Item Tags
        • Tag Item Status Raw
        • Tag Item Status
        • Tag Item Publish Link
        • Tag Item Permanent URL
        • Tag Item Prevnext Links
        • Tag Item Type
        • Tag Item Permanent Link
        • Tag Item Msgform Link Assigned
        • Tag Item Msgform Link
        • Tag Item More Link
        • Tag Item Mod Time
        • Tag Item Mod Date
        • Tag Item Trackback URL
        • Tag Item Views
        • Tag Item Locale Temp Switch
        • Tag Skin Get Path
        • Tag User Subs Link
        • Tag User Register Link
        • Tag User Profile Link
        • Tag User Logout Link
        • Tag User Login Link
        • Tag Skin Get URL
        • Tag Skin Container
        • Tag Item Wordcount
        • Tag Powered By
        • Tag Plugins Call By Code
        • Tag Messages
        • Tag Mainlist Page Links
        • Tag Locale Restore Previous
        • Tag Locale Lang
        • Tag Locale Charset
        • Tag Item Main Category
        • Tag Item Locale Flag
        • Include Disp
        • Tag Blog Tagline
        • Item::author()
        • Tag Item Anchor
        • Tag Is Logged In
        • Tag Display If Empty
        • Tag Credits
        • Tag Comment Allowed Tags
        • Tag Blog Name
        • Tag Item Can Rate
        • Tag Blog Longdesc
        • Tag Blog Home Link
        • Tag Blog Footer
        • Tag Blog Contact Link
        • app_version();
        • Tag Request Title
        • Include Item Content
        • Tag Item Can Comment
        • Tag Item Can Recieve Pings
        • Tag Item Locale
        • Tag Item Feedback Moderation
        • Tag Item Language
        • Tag Item Lang
        • Tag Item Issue Date
        • Tag Item Images
        • Tag Item Has Feedback
        • Tag Item Footer
        • Tag Item Files
        • Tag Item Feedback Link
        • Tag Item Categories
        • Tag Item Feedback Feed Link
        • Tag Item Extra Status
        • Tag Item Edit Link
        • Tag Item Deprecate Link
        • Tag Item Deadline Time
        • Tag Item Deadline Date
        • Tag Item Content Teaser
        • User::get_identity_link()
      • 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
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Community 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

Web Hosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Web hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Internatl: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • Google+
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque · Supported by the Evo Factory