Include disp
From B2evolution
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
| $disp | Called 2nd level template | See example in this skin |
|---|---|---|
| 'arcdir' | _arcdir.disp.php | custom |
| 'catdir' | _catdir.disp.php | custom |
| 'comments' | _comments.disp.php | custom |
| 'feedback-popup' | _feedback_popup.disp.php | - |
| 'mediaidx' | _mediaidx.disp.php | photoblog |
| 'msgform' | _msgform.disp.php | custom |
| 'page' | _page.disp.php | |
| 'posts' | _posts.disp.php | |
| 'profile' | _profile.disp.php | custom |
| 'single' | _single.disp.php | |
| 'subs' | _subs.main.php | custom |
[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().

