Template Help
This blogging site uses a modified version of ETS to manage our templates. You can read the ETS manual at it's site for information on advanced uses, but I will do my best to describe how to use it with your blog here.
Tags
{link_home} Will output all needed HTML to give a link to your blogs homepage.
{url_home} Prints just the URL to the first page of your blogs.
{link_profile} Similar to above, but links to your profile page.
{url_profile} Prints just the URL to your profile page.
{link_friends} Displays text "Friends" as a link to your friends page.
{url_friends} The URL to your friends page.
{username} Will display your username.
{link_page_prev} Will link to the previous page of blogs, assuming there is one. Otherwise, this will produce nothing
{url_page_prev} Prints just the url to the previous page of blogs. Only prints when there is a previous page.
{link_page_next} Same idea as above, but prints link to next page of blogs
{url_page_next} Prints just the URL to the next page of blogs.
{add_comment_block} Creates a <textarea> that allows people to post comments. This will only work if a user is viewing a specific blog. If the user is not loged in, then it will instruct the user to do so.
{rss_img} Prints the HTML needed to see as a link to your RSS feed page.
{rss_url} Displays only the URL to your RSS Feed
Blog Tags
These tags will only work within the blog mask. ex: {mask:blog}
{subject} The subject of the current blog.
{date} The date, formatted to your settings.
{body} Body of the blog.
{mood} Mood, assuming you typed something in. If not, then won't exist for current blog.
{custom_title} The name of your custom field.
{custom_text} Value for you custom filed for the current blog. If you didn't type something in, then this wont exist for that blog.
{comments_url} The full URL to where comments can be viewed. Idea is to use it in a <a> tag.
{comments_link} Generic link to your comments.
{comments_num} The number of comments for this perticual blog.
Comment Tags
These are defined in the comments mask. ex: {mask:comments}. The will only have value if the user is viewing comments. Otherwise the wont exist.
{author} The author of the comment.
{author_link_blogs} Authors name as link to his/her blog page.
{author_url_blogs} URL to the authors blogs.
{author_link_profile} Authors name as link to his/her profile page.
{author_url_profile} URL to the authors profile.
{comment} The body of the comment.
{date} The date the comment was posted.
Notes & tips
TAGS ARE CASE SENSITIVE!!
Masks ({mask:main}, {mask:blog}, {mask:comments}) are groupings of tags that will be looped through. Lets take the blog mask for an example.
{mask:blog} {subject} posted {date} <br> {body} <p> {/mask}
In the above example, the template engine will loop from {mask:blog} to {/mask} and replace all tags with the appropriate data for the current blog.
You can put comments in your code using {* and *}. Anything between {* and *} will not be displayed.
The tag {add_comment_block} displays a <textarea> using the CSS class "add_comment_block". You can define it in your template to change how it will look. This is the only tag that uses a specific CSS class. You can still change how links work with CSS.
You can use the {set} function tag to check if other tags are active. Here is an example:
{set:url_page_next} <a href="{url_page_next}">Next page of blogs {/set}
The link "Next page of blogs" will only be displayed if the tag {url_page_next} is set. Don't forget to have the {/set} tag!
You can also check for a specific value of a tag. Here is an example:
{set:comments_num:0} Be the first to comment! {/set}
The {mis} function tag can be used just like the {set} function tag, except to check if a tag is not activated. Here is another example:
{mis:url_page_next} Last Page {/mis}
Also like the {set} tag, you can check for when a tag does not have a specific value:
{mis:comments_num:0} There are comments {/mis}
Here is an example using both {set} and {mis}:
{mask:blog} {subject} - {date} <br> {body}
There are
{set:comments_num:0} Zero comments {/set}
{mis:comments_num:0} Some comments {/set}
{/mask}
Example Template Here is an example template for reference:
{mask:main}
<html><head><title>My Blog Page</title></head>
<body>
<center><h2>My Cool Blogs</h2></center>
{link_home} {link_profile} {link_page_prev} {link_page_next}
<p>
<table>
{mask:blog}
<tr><td>{date}<br>Mood: {mood}<br>{custom_title}: {custom_text}</td>
<td><b>{subject} <br> {body} <br>There are {comments_num} comments. <a href="{comments_url}">Read them now</a>
</td></tr>
{/mask}
</table>
{mask:comments}
<hr>Posted {date} by {author_link_blogs}<br>{comment}<br><br>
{/mask}
<br>{add_comment_block}
</body>
</html>
{/mask}
|