Powered by MediaWiki
Personal tools

Include disp

From B2evolution

Jump to: navigation, search

This template tag includes a "second level" 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.

Contents

[edit] Example

<?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 ---------------------------
?>

[edit] 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.

[edit] Included files

$dispCalled 2nd level templateSee example in this skin
'arcdir'_arcdir.disp.phpcustom
'catdir'_catdir.disp.phpcustom
'comments'_comments.disp.phpcustom
'feedback-popup'_feedback_popup.disp.php-
'mediaidx'_mediaidx.disp.phpphotoblog
'msgform'_msgform.disp.phpcustom
'page'_page.disp.php
'posts'_posts.disp.php
'profile'_profile.disp.phpcustom
'single'_single.disp.php
'subs'_subs.main.phpcustom

[edit] Disabled 'disp_posts'

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

<?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, 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().