LesTemplates

Templates

  • Templates

The output templating system uses a set of template files for each publication type and depends on the PostNuke .75 pnRender system (see installation guide).

Note
You can read a lot more about the Smarty templating system (that pnRender builds on, and thereby Pagesetter) on smarty.php.net. 
The template files are stored in pagesetter/pntemplates/... and they are named after the publication template name like "template-format.html" where template is specified in the publication setup and format depends on the situation.

  • Pagesetter uses the following formats in various situations (here an example filename is shown in the parenthesis):

list (News-list.html)
The compact view of a publication when shown in a list.
list-header (News-list-header.html)
A template shown before a list.
list-footer (News-list-footer.html)
A template shown after a list.
list-single (News-list-single.html)
This single template takes the place of list, list-header, and list-footer in case no list-header template is found. This kind of list templates gives you more control over the layout, but disables caching of the list output.
full (News-full.html)
The full view of a publication.
print (News-print.html)
The full view of a publication when shown as "Print this" without PostNuke frames.
xml (News-xml.html)
Full view of publication as XML. Used for the xmllist and xmlpub functions that adds a "Content-Type: text/xml" to the HTTP header.

Important
1) Remember to make pagesetter/pntemplates writeable by the webserver if you want to use Pagesetter automatic generation of templates.

2) You always specify a format (like "RSS") when asked to supply a template in a block or URL. You do not specify a full filename!

3) If a list display cannot find a template header, for instance News-list-header.html then it assumes a single template list is used and looks for the format "list-single" instead, for instance News-list-single.html.

  • Le calibre employé pour afficher vos données est appelé PN-News-full.html et est situé dans le répertoire pntemplates. Comme vous pouvez le voir, le nom consiste à un assemblage du nom de publication enchaîné avec un tiret et un nom de format de calibre (dans ce cas-ci "full"). Si vous ouvrez le dossier vous verrez quelque chose comme :
    • Exemple 1.0 de l'Exemple de calibre (template) pour l'item de nouvelle.

 // (the html presented is not the most correct with respect 
 // to accessibility and xhtml compliancy)
 <div style="width: 500px;">
 <div class="pn-title"><!--[$title]--></div>
 <div class="pn-sub">By: <!--[$core.author]--> 
 (<!--[$core.creator]-->) 
 <!--[$core.lastUpdated|date_format:"%Y.%m.%d"]--></div><p>
 <table>
 <tr>
  <td valign="top">
   <!--[$text[$core.page]]--><br>
   <!--[if $core.pageCount > 1 ]-->
   Page: <!--[pagesetter_pager]-->
   <!--[/if]--></code>
  </td></code>
  <td valign="top">
   <!--[if $image != "" ]-->
     <img src="<!--[$image]-->" width="200" 
          alt="<!--[$imagetext]-->" 
        title="<!--[$imagetext]-->"><br>>
     <i><!--[$imagetext]--></i>
   <!--[/if]-->
  </td>
 </tr>
 </table>
<p>
<table width="100%"><tr>
<td><!--[$core.printThis]--> | <!--[$core.sendThis]--> 
| Hits: <!--[nocache]--><!--[$core.hitCount]--><!--[/nocache]-->
| <!--[nocache]--><!--[$core.editInfo]--><!--[/nocache]--></td>
<!--[if $core.pageCount > 1 ]-->
 <td align="right">(Page <!--[$core.page+1]--> 
 of <!--[$core.pageCount]-->)</td>
<!--[/if]-->
</tr></table>
</div> 

  • le tag HTML de commentaire <!--[ ]--> contient le code pour le système pnRender templating. Fondamentalement vous pouvez mettre $fieldName dans ce tag pour montrer vos sources de publication, mais une substance plus complexe comme des rapports et des boucles de commutation peut être ajoutée aussi. Le nom de variable $core est prédéfini par Pagesetter et contient des informations de noyau sur la publication comme la date de création et l'auteur.

N'éditez pas le calibre directement. Copiez le à la place d'un calibre spécifique de thème et mettez le dans votre répertoire de thèmes comme décrit dans le chapitre de calibre.

  • Theme Specific Templates

With the pnRender system it is possible to specifiy theme specific templates. Just place your templates in the structure shown here (the top theme directory is PostNuke's main theme directory):