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:
$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:
$Item->issue_date( array(
) );
Or it could be trimmed down even further, like this:
$Item->issue_date();
On the contrary, you can also add parameters. For example, you could specify the date format to use, like this:
$Item->issue_date( array(
'before' => '<span class="timestamp">',
'after' => '</span>',
'date_format' => 'Y-m-d',
) );