MyFeedList Template Tutorial

What is a template?

A template is a html page with special tags. You can recognise a special tag at the following format: [tag]. When a feedlist is displayed by the system, the template is read and the special tags are replaced with content that actually means something. For example there is a tag called [col_width], this tag defines the preferred size of a table column, 33% if you have a feedlist 3 columns, 25% if you have 4 columns, 50% is you have only 2 columns. When your feedlist is displayed the [col_width] tag is replaced with that number.

Subtemplates

A template can contain other templates, these are called subtemplates. A start of a subtemplate can be marked with a special tag [something_begin], also the end of a subtemplate can be marked with a special tag [something_end]. The word "something" is replaced with the name of the subtemplate. For example on a feedlist we have the subtemplate Box, the starting tag for this subtemplate is [box_begin] and the end tag is [box_end].

Subtemplates like the Box template can contain normal tags and other subtemplates. The Box template for example can contain [box_title] (replaced with the box title) and [box_body] (replaced with the content of the box).

A subtemplate can also contain conditional tags, like [if_isfeed] and [if_isbox]. Don't worry if you don't understand these, they will be explained later on.

A simple example

A myfeedlist template contains of subtemplates and many tags. To give you a general overview of all the subtemplates and tags i have made a simple template that represents a very simple but functional feedlist:

<html>
<body>
[body_start]

<table border=0 cellspacing=0 cellpadding=0>
<tr>
[col_begin]
<td width="[col_width]">
[box_begin]
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<tr><td>[box_title]</td></tr>
<tr><td>

[if_isfeed]
<!-- box is a feed box -->
<ul>
[item_begin]
<li><a href="[item_url]" target="_blank">[item_title]</a>[if_isnew]<img src="http://images.imageturtle.com/fl/new.gif">[end_isnew]</li>
[item_end]
</ul>
[end_isfeed]

[if_isbox]
<!-- box is a normal box -->
[box_body]
[end_isbox]

</td></tr>
</table>
[box_end]
</td>
[col_end]
</tr>
</table>

[body_end]
</body>
</html>

As you can see it is a simple html page (with tags) with html code for a simple table. Lets take a closer look:

<html>
<body>
[body_start]

<table border=0 cellspacing=0 cellpadding=0>
<tr>
[col_begin]
<td width="[col_width]">
[box_begin]
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<tr><td>[box_title]</td></tr>
<tr><td>

The first couple lines are plain html, the interesting line is the one that starts with [col_begin] that is the start of the Column template. The Column template defines the contents of a column. The Column template usual contains the Box template, that one starts at [box_begin]. But wait i overlooked [col_width], this tag is replaced by the preferred width of a column.

There is a [body_start] tag after the <body> html tag, this tag defines the end of the page header. A page header usual contains a image header or a feedlist title. There is also a [body_end] tag, we will take a closer look at that one later.

Now we are at the last three lines, this is where the Box template starts, as you can see it contains one tag: [box_title], this tag is replaced by the title of the box.

[if_isfeed]
<!-- box is a feed box -->
<ul>
[item_begin]
<li><a href="[item_url]" target="_blank">[item_title]</a>[if_isnew]<img src="http://images.imageturtle.com/fl/new.gif">[end_isnew]</li>
[item_end]
</ul>
[end_isfeed]

[if_isbox]
<!-- box is a normal box -->
[box_body]
[end_isbox]

</td></tr>
</table>
[box_end]
</td>
[col_end]
</tr>
</table>

[body_end]
</body>
</html>

Conditional tags

Now we are in the Box template and when we look at the longest line we see our first conditional tag [if_isnew]:

[if_isnew]<img src="http://images.imageturtle.com/fl/new.gif">[end_isnew]

This means that if a rss item is new then the image at url "http://images.imageturtle.com/fl/new.gif" is shown, if the rss item is not new then the html between the [if_isnew] and [end_isnew] tags is removed.

The same applies for the other condition tags like [if_isfeed]. If the box is a feed box (a box with rss items) then the section between [if_isfeed] and [end_isfeed] is processed. If you look a little further you will see another conditional tag [if_isbox], so if the box is a normal box (a box with no rss items) then the section between [if_isbox] en [end_isbox] is processed.

Processed means that the html and tags are displayed and not removed.

When a box is a feed box the section between [if_isfeed] and [end_isfeed] is processed. As you can see there is a lot html and tags in that section.

[if_isfeed]
<!-- box is a feed box -->
<ul>
[item_begin]
<li><a href="[item_url]" target="_blank">[item_title]</a>[if_isnew]<img src="http://images.imageturtle.com/fl/new.gif">[end_isnew]</li>
[item_end]
</ul>
[end_isfeed]

There is even a new subtemplate the Item subtemplate (between [item_begin] and [item_end]), this one stands for a single RSS item and can contain tags like [item_url] (replaced with the url to the blog post) and [item_title] (replaced with the title of the blog post).

There is only one tag between the [if_isbox] and [end_isbox] that's [box_body], this tag is replaced with the content of a normal box. Only a normal box can have a [box_body] tag, a feed box has the Item template.

The last eight or nine lines includes html codes and tags that define the end of the Box and Column template. There is also the [body_end] tag, this tag defines the beginning of the page footer. A page footer is the bottom part of the page, it may contain copyright notices or something else.

Sum it up

Lets sum it up. The myfeedlist template contains the Column template, the Column template contains the Box template. If the box is a feed box then the Box template contains the Item template.

All these templates can contain tags:

Feedlist template

Tag Required Replace by
[if_ispage] [end_ispage] No The section between these tags will be displayed when the current page is a Page and no FeedList.
[page_begin] [page_end] No The start and end tag of the Page template.
[col_begin] [col_end] Yes The start and end tag of the Column template.
[body_start] [body_end] Yes [body_start] defines the end of the page header and [body_end] defines the beginning of the page footer.

Column template

Tag Required Replace by
[col_width] No The preferred width of a column.
[box_begin] [box_end] Yes The start and end tag of the Box template.
[if_iscolX] [end_iscolX] No The section between these tags will be displayed when the number of the column is X. For example: [if_iscol1]Wow, this is column 1[end_iscol1] or [if_iscol3]Wow, this is column 3[end_iscol3]

Box template

Tag Required Replace by
[box_title] Yes The title of a box
[box_body] Yes The contents of a box, this tag is only valid when the box is a normal box.
[if_isfeed] [end_isfeed] Yes The section between these tags will be displayed when the box is a feed box.
[if_isbox] [end_isbox] Yes The section between these tags will be displayed when the box is a normal box.
[if_ispagebox] [end_ispagebox] No The section between these tags will be displayed when the box is a page box.
[if_islinkbox] [end_islinkbox] No The section between these tags will be displayed when the box is a link box.
[if_isblogbox] [end_isblogbox] No The section between these tags will be displayed when the box is a blog box.
[if_ispostbox] [end_ispostbox] No The section between these tags will be displayed when the box is a post box.
[if_isnewbox] [end_isnewbox]   The section between these tags will be displayed when the box is a NewBox.
[item_begin] [item_end] Yes The start and end tag of the Item template.
[page_begin] [page_end] No The start and end tag of the Page template.
[link_begin] [link_end] No The start and end tag of the Link template.
[blog_begin] [blog_end] No The start and end tag of the Blog template.
[postitem_begin] [postitem_end] No The start and end tag of the PostItem template.
[newitem_begin] [newitem_end] No The start and end tag of the NewItem template.
[feedbox_id] No A unique number that identifies a feed box.
This tag is only valid when the current box is a feed box. Use: [if_isfeed]The feed ID is: [feedbox_id][end_isfeed]
[feedbox_updateddate] No The date when the items in the feed box were updated.
This tag is only valid when the current box is a feed box.
[feedbox_url] No A url that points to the blog that owns the RSS feed.
This tag is only valid when the current box is a feed box.
[feedbox_feedurl] No A url that points to the RSS feed.
This tag is only valid when the current box is a feed box.
[if_hasnew] [end_hasnew] No The section between these tags will be displayed when the feed box has new items.
This tag is only valid when the current box is a feed box.

Item template

Tag Required Replace by
[item_url] Yes The url that points to the blog post.
[item_title] Yes The title of the blog post.
[if_isnew] [end_isnew] No The section between these tags will be displayed when the blog post is a new one.

Page template

Tag Required Replace by
[page_url] Yes * The url that points to the page.
[page_title] Yes * The title of the page.

* required when a [page_begin] [page_end] is defined

Link template

Tag Required Replace by
[link_url] Yes * The url from the link.
[link_title] Yes * The title of the link.

* required when a [link_begin] [link_end] is defined

Blog template

Tag Required Replace by
[blog_url] Yes * The url of the blog.
[blog_title] Yes * The title of the blog.
[blog_feedurl] No The url of the feed of the blog.

* required when a [blog_begin] [blog_end] is defined

PostItem template

Tag Required Replace by
[feed_title] No The title of the blog that owns the feed.
[feed_feedurl] No The url to the feed.
[feed_url] No The url of the blog that owns the feed.
[feed_id] No Unique ID of feed
[item_date] No Post date of the blog post.
[item_url] No Url that points to the orginal blog post.
[item_title] No Title of the blog post.
[item_message] No The non-formatted text of the blog post.
[item_extra1] No The value of the Extra1 mapping.
[item_extra2] No The value of the Extra2 mapping.
[item_f_subject] No The formatted subject of the blog post (after applying AutoLinks and WordRewriter)
[item_f_message] No The formatted text of the blog post (after applying AutoLinks and WordRewriter)

NewItem template

Tag Required Replace by
[feed_title] No The title of the blog that owns the feed.
[feed_feedurl] No The url to the feed.
[feed_url] No The url of the blog that owns the feed.
[feed_id] No Unique ID of feed
[item_date] No Post date of the blog post.
[item_url] No Url that points to the orginal blog post.
[item_title] No Title of the blog post.

 

What now?

Do you not understand something? Ask your questions on the Support Forum.
Learning from a example and changing a example to see the effect of the change works the best, take a look at the html code and special tags of the Classic template.