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
// -------------- 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
<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
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()
.