Wednesday 23 July 2003 3:10:51 pm
You can make templates files (with .tpl extension) and put them in your /design/user/templates directory (if 'user' is your site directory). Put the template-code and html in these files and include them from your pagelayout template, where you want them to appear, like this: {include uri="design:your_template.tpl"} For example, this is the code I use to display the latest 5 forum messages in the right column of the site I'm setting up:
<literate>
-------------------------------
<table width="120" border="0" cellpadding="5" cellspacing="0">
<tr>
<td bgcolor="#000000">
<b class="smalltitle">Last 5 messages</b><br>
{section name=Message loop=fetch( content, tree, hash(
parent_node_id, 73,
limit, 5,
sort_by, array( published, false() ),
class_filter_type, include,
class_filter_array, array( 7 ) ) ) }
<span class="menu"> • </span><a class="menu" href={concat( "/content/view/full/", $Message:item.node_id, "/" )|ezurl}>{$Message:item.name|wash}</a><br>
{/section}
</td>
</tr>
</table>
-------------------------- </literate> Templates to view objects (nodes) should be stored in /design/user/overide/templates/ and initilized by editing the override.ini file. Take a look in the /settings/siteaccess/demo/ directory to see how it is set up and locate the templates in /design/demo/override/templates/. Try editing the template files and see how it is displayed on the demo site. Remember to turn off view cachin in site.ini (search for "ViewCaching" and set it to disabled), or else you won't see your changes. Hope this help you getting started.
|