Home Sign up Features Members Forums Control menu Search
Upsaid templates tutorials

Entry pages - step two: Building the "Comment template"

We are now going to take care of the Comments temlate. This template is the equivalent of the "Entry Templates" we have build for the Main page, exept that instead of displaying entries, we display comments, using the !!comment!! variable.

Here is an exemple of what you could type in the "Comment" template:

<table width="300" bgcolor="#C1BFEE">
    <tr><td>!!comment!!</td></tr>
</table>
The result would look something like...
This is a comment.
You may of course display the date and time the comment was posted by inserting the appropriate variables.
<table width="300" bgcolor="#C1BFEE">
    <tr><td>!!comment!!</td></tr>
    <tr><td>Posted on !!monthdigit!!.!!monthday!!.!!year!!
    at !!hours12!!:!!minutes!! !!ampm!!</td></tr>
</table>
This is a comment.
Posted on 08.14.02 at 7:28 pm
In order to display the name of the comment's author, you need to insert either the !!name!! variable, which simply displays the author's name, or the !!authorsmart!! variable, which displays the author's name, linking to his/her e-mail if he/she mentioned one.
<table width="300" bgcolor="#C1BFEE">
    <tr><td>!!comment!!</td></tr>
    <tr><td>Posted by on !!monthdigit!!.!!monthday!!.!!year!!
    at !!hours12!!:!!minutes!! !!ampm!!</td></tr>
    <tr><td>By !!authorsmart!!</td></tr>
</table>
This is a comment.
Posted by on 08.14.02 at 7:28 pm
By Jim
Now, since we will include this template inside another table later, we need to put a <tr><td> at the begining, and a </td></tr> at the end of our code:
<tr><td><table width="300" bgcolor="#C1BFEE">
    <tr><td>!!comment!!</td></tr>
    <tr><td>Posted by on !!monthdigit!!.!!monthday!!.!!year!!
    at !!hours12!!:!!minutes!! !!ampm!!</td></tr>
    <tr><td>By !!authorsmart!!</td></tr>
</table></td></tr>
We're done! All we need to do now is to include this into the "Entry main page" template by inserting the !!dispcom!! variable inside a html table:
<html>

<head>
    <title>My Upsaid web log - Entry page</title>
</head>


<body>


<table width="400" bgcolor="#D0F0EB">
    <tr><td><u>!!title!!</u></td></tr>
    <tr><td>!!body!!</td></tr>
    <tr><td align="right">Posted at !!hours12!!:!!minutes!! !!ampm!!</td></tr>
</table>

<table>
    !!dispcom!!
</table>


</body>

</html>
This is a title
This is the entry body
Posted at 2:37 pm
This is another comment.
Posted by on 08.15.02 at 4:28 pm
By Sara
This is a comment.
Posted by on 08.14.02 at 7:28 pm
By Jim
All we need to do now is add the "Post a comment" form, and we will be done with the Entry page.
© Upsaid.com, 2001 - 2003 Contact us - Privacy policy - Terms of use