b2evolution b2evolution

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

Include Disp

The skin_include( '$disp$' template tag includes a sub-template, a.k.a. "disp" template based on the value of the $disp variable, i-e: based on the type of content that should be displayed on the current page. "disp" templates have a filename ending in .disp.php.

Example

PHP

<?php
  // -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------
  skin_include( '$disp$', array(
       'disp_posts'  => '',		// We already handled this case above
       'disp_single' => '',		// We already handled this case above
       'disp_page'   => '',		// We already handled this case above
     ) );
  // Note: you can customize any of the sub templates included here by
  // copying the matching php file into your skin directory.
  // ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------
?>

Parameters

By passing specific $disp => 'filename.disp.php' pairs in the param array, you can control what template you want to have called based on any $disp value.

This is mostly useful for disabling some $disp values (as in the example above) if display of that content has already been taken care of.

More info below.

Included files

Html

<table border="1">
<tr>
  <th>$disp</th><th>Called 2nd level template</th><th>See example in this skin</th>
</tr>
<tr>
  <td>'arcdir'</td><td>_arcdir.disp.php</td><td>custom</td>
</tr>
<tr>
  <td>'catdir'</td><td>_catdir.disp.php</td><td>custom</td>
</tr>
<tr>
  <td>'comments'</td><td>_comments.disp.php</td><td>custom</td>
</tr>
<tr>
  <td>'feedback-popup'</td><td>_feedback_popup.disp.php</td><td>-</td>
</tr>
<tr>
  <td>'mediaidx'</td><td>_mediaidx.disp.php</td><td>photoblog</td>
</tr>
<tr>
  <td>'msgform'</td><td>_msgform.disp.php</td><td>custom</td>
</tr>
<tr>
  <td>'page'</td><td>_page.disp.php</td><td></td>
</tr>
<tr>
  <td>'posts'</td><td>_posts.disp.php</td><td></td>
</tr>
<tr>
  <td>'profile'</td><td>_profile.disp.php</td><td>custom</td>
</tr>
<tr>
  <td>'single'</td><td>_single.disp.php</td><td></td>
</tr>
<tr>
  <td>'subs'</td><td>_subs.main.php</td><td>custom</td>
</tr>
</table>

Disabled ‘disp_posts’

Some skins have the most common disp values disabled like this:

PHP

<?php
  skin_include( '$disp$', array(
       'disp_posts'  => '',		// We already handled this case above
       'disp_single' => '',		// We already handled this case above
       'disp_page'   => '',		// We already handled this case above
     ) );

This is because the index.main.php file already includes the code for those display cases within the main template. Thus calling them again as disp templates would produce duplicate content.

If you want to externalize those disp cases to a separate .disp.php file, you need to:

  • delete the section that displays them in the main template
  • and delete the lines that disable the calling of the disp template in skin_include().
Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:24 • •

No feedback yet

On this page

  • Example
  • Parameters
  • Included files
  • Disabled ‘disp_posts’

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
      • Skin Development Primer
      • 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 Plugins Call By Code
        • 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 Get Path
        • Tag Skin Container
        • Tag Powered By
        • Tag Is Logged In
        • Include Disp
        • Tag Display If Empty
        • Tag Comment Allowed Tags
        • Tag Blog Tagline
        • Tag Blog Name
        • Tag Blog Longdesc
        • Tag Blog Home Link
        • Tag Blog Footer
        • Tag Blog Contact Link
        • app_version();
        • Tag Request Title
        • Include Item Content
        • User::get_identity_link()
        • Item Tags
        • Category Tags
        • User Tags
        • Other Tags
      • 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
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Free blog engine

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

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

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

Founded & Maintained by François Planque