Chapter 8: Custom Templates

iBlog uses a set of 8 templates to create the HTML files. When you click the Preview button, iBlog uses these templates to compose the content of the HTML files it generates, together with Stylesheets this system provides a completely customizable solution to separate content from presentation.

You can think of Templates as handling the content part and Stylesheets as handling the presentation part of the generated HTML pages. Actually the templates do a little more than holding the content, they also define the layout of the content, for example the built-in templates divide the whole page in to two vertical columns namely "Content" and "Navigation". The Content column holds the actual entry abstract and body while the Navigation column holds Calendar, QuickLinks, Statistics etc.

Since you require a set of templates that are closely related to define the layout of the content in the HTML pages, they are collectively referred to as a template set. iBlog comes with two pre-built template sets namely Left Navigation and Right Navigation. Each template set has 6 template files it in, each corresponding to the HTML page to be generated by Preview. The Names of the template files are self explanatory as to which HTML file they are used for. The built-in templates sets are located in ~/Library/Application Support/iBlog/TemplateSets folder (~ is your HOME folder).



To make it easier to built custom templates iBlog includes a simple template set builder. Each template set consists of 6 files(ArchivePage.txt, BlogPage.txt, CategoryPage.txt, DayPage.txt, EntryPage.txt, MonthPage.txt, YearPage.txt). Since the FeedPage.txt and HomePage.txt are common for all template sets they are saved directly in the ~/Library/Application Support/iBlog/TemplateSets folder. Your new folder holding the custom template files will be saved in ~/Library/Application Support/iBlog/TemplateSets folder.

Template Tags

iBlog uses a set of predefined tags in the template pages. These tags act as place holders for the actual data. During Preview these tags are replaced with the actual content by iBlog. Most of the tags are common for all the template pages but some are only valid/defined for some template pages. See the sections below for exactly what tags are defined for each page and what content they actually refer to.

Navigation Column Tags



The content of the navigation area is completely customizable. This is achieved through editing the template pages and using the built-in Navigation Editor. The Navigation Editor provides a convenient way to create new sections in the navigation column and selectively include this in the HTML pages. The navigation editor comes with 4 prebuilt nagivation sections. These factory default navigation sections use Template Tags that are replaced by the actual content during Preview operation by iBlog.


Calendar Section
This section is used to create a calendar for quick access to entries by date. iBlog replaces this section with a calendar for the current month. By default Calendar section is visible in the Blog, Category and Entry pages.

<$CalendarHead$> : This tag is replaced by the actual month and year of the current day.

<$CalendarRows$> : This tag is replaced by the actual days in the current month. Days for which there are entries are hyperlinked to the Day page for that day.

Categories Section
This section is used to display a list of categories in the current blog. By default Categories section is visible in the Blog, Category and Entry pages.

<$Categories$> : This tag is replaced by the list of categories in the blog.

Archives Section
This section is used to display a quick link to the main archives page for the current blog. By default Archives section is visible in Blog, Category, Entry, Year, Month and Day pages.

<$ArchivesLink$> : This tag is replaced by a URL to the main archive page of the blog.

XML/RSS Feed Section
This section is used to display a quick link to the Feed file for the current blog. By default XML/RSS Feed section is visible in Blog, Category, Entry, Archive, Year, Month and Day pages.

<$SyndicateLink$> : This tag is replaced by a URL to the RSS feed page of the blog.

Custom BlogPage Template

To create a custom BlogPage template create a new file named "BlogPage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets.

Template Tags in BlogPage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$BlogName$> : This tag corresponds to the name of the blog.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<ForEachEntry>, </ForEachEntry> : These tags are used to enclose the content of the entries in a blog. Each blog can possibly contain many entries, The content inside these tags (including other template tags) is repeated for each entry in the blog. These tags are required to display the content of blog entries in the blog page.

<$EntryPostDate$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's post date.

<$CategoryImage$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's category image.

<$EntryTitle$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's title.

<$EntryAbstractOrBody$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's abstract or body based on the Preview preferences for this blog. If the preference is to display the entry abstract in the blog page then this tag is replaced by the entry abstract content else if the preference is to display the entry body in the blog page then this tag is replaced by the entry body content.

<$CategoryLink$> : This tag appears inside the "ForEachEntry" tag pair and represents the URL to the category page of the entry.

<$EntryCategory$> : This tag appears inside the "ForEachEntry" tag pair and represents the Category name of the entry.

<$EntryUUID$> : This tag appears inside the "ForEachEntry" tag pair and represents the unique ID assigned to the entry. This unique ID acts as a unique title for each entry.

<$EmailFeedback$> : This tag appears inside the "ForEachEntry" and creates a mailto: link if the email is set in the General Preferences. If the email is not set in the General preferences this is replaced by an empty string.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$BlogEntriesCount$> : This tag is used inside the Statistics section of the Navigation column and represents the number of entries in the blog.

<$CategoryStatistics$> : This tag is used inside the Statistics section of the Navigation column and is replaced by the Category Name and the number of entries in each for all the categories in that blog.

<$PublishDate$> : This tag is used inside the Statistics section of the Navigation column and is set to the current day when Preview creates the HTML file.

<$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom CategoryPage Template

To create a custom CategoryPage template create a new file named "CategoryPage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets.

Template Tags in CategoryPage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$CategoryName$> : This tag corresponds to the name of the category.

<$BlogBaseURL$> : This tag is replaced by the URL to the blog folder for this category.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<ForEachEntry>, </ForEachEntry> : These tags are used to enclose the content of the entries in a category. Each category can possibly contain many entries, The content inside these tags (including other template tags) is repeated for each entry in the category. These tags are required to display the content of category entries in the category page.

<$EntryPostDate$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's post date.

<$CategoryImage$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's category image.

<$EntryTitle$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's title.

<$EntryAbstractOrBody$> : This tag appears inside the "ForEachEntry" tag pair and represents the entry's abstract or body based on the Preview preferences for this category. If the preference is to display the entry abstract in the category page then this tag is replaced by the entry abstract content else if the preference is to display the entry body in the category page then this tag is replaced by the entry body content.

<$EntryBlog$> : This tag appears inside the "ForEachEntry" tag pair and represents the Blog name of the entry.

<$EntryUUID$> : This tag appears inside the "ForEachEntry" tag pair and represents the unique ID assigned to the entry. This unique ID acts as a unique title for each entry.

<$EmailFeedback$> : This tag appears inside the "ForEachEntry" and creates a mailto: link if the email is set in the General Preferences. If the email is not set in the General preferences this is replaced by an empty string.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$BlogEntriesCount$> : This tag is used inside the Statistics section of the Navigation column and represents the number of entries in the blog.

<$CategoryEntriesCount$> : This tag is used inside the Statistics section of the Navigation column and represents the number of entries in the category.

<$PublishDate$> : This tag is used inside the Statistics section of the Navigation column and is set to the current day when Preview creates the HTML file.

<$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom EntryPage Template

To create a custom EntryPage template create a new file named "EntryPage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets.

Template Tags in EntryPage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$EntryBlog$> : This tag corresponds to the blog name for this entry.

<$EntryCategory$> : This tag corresponds to the category name for this entry.

<$EntryTitle$> : This tag corresponds to the title of the this entry.

<$BlogBaseURL$> : This tag is replaced by the URL to the blog folder for this entry.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<$EntryPostDate$> : This tag corresponds to the post date set for the entry.

<$EntryAbstract$> : This tag corresponds to the abstract of the entry.

<$EntryBody$> : This tag corresponds to the body of the entry.

<$CategoryLink$> : This tag represents the URL to the category page of the entry.

<$EmailFeedback$> : This tag creates a mailto: link if the email is set in the General Preferences. If the email is not set in the General preferences this is replaced by an empty string.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$BlogEntriesCount$> : This tag is used inside the Statistics section of the Navigation column and represents the number of entries in the blog.

<$CategoryEntriesCount$> : This tag is used inside the Statistics section of the Navigation column and represents the number of entries in the category.

<$PublishDate$> : This tag is used inside the Statistics section of the Navigation column and is set to the current day when Preview creates the HTML file.

<$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom ArchivePage Template

To create a custom ArchivePage template create a new file named "ArchivePage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets. Archive page displays a list of all the years that contain entries.

Template Tags in ArchivePage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$BlogName$> : This tag corresponds to the name of the blog.

<$BlogBaseURL$> : This tag is replaced by the URL to the blog folder.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<ArchiveList>, </ArchiveList> : These tags are used to enclose the list of years in the archive page.

<$ArchiveLink$> : This tag is replaced by a link to the archive year.

<$ArchiveTitle$> : This tag is replaced by the name of the archive year.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$ArchiveEntriesCount$> : This tag is replaced by the count of entries in the archive (all the entries in the blog).

<$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom YearPage Template

To create a custom YearPage template create a new file named "YearPage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets. Year page displays a list of all the months in the year that contain entries.

Template Tags in YearPage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$BlogName$> : This tag corresponds to the name of the blog.

<$ArchiveYear$> : This tag is replaced by the name of the archive year.

<$BlogBaseURL$> : This tag is replaced by the URL to the blog folder.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<ArchiveList>, </ArchiveList> : These tags are used to enclose the list of months in the year page.

<$ArchiveLink$> : This tag is replaced by a link to the archive month.

<$ArchiveTitle$> : This tag is replaced by the name of the archive month.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$YearEntriesCount$> : This tag is replaced by the number of entries in this year for the blog.

<$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom DayPage Template

To create a custom DayPage template create a new file named "DayPage.txt" in the custom template folder in ~/Library/iBlog/TemplateSets. Day page displays a list of all the entry titles posted on that specific day.

Template Tags in DayPage.txt
<$AuthenticationLink$> : This tag corresponds to the Javascript that performs the user authentication using encrypted username and password for private blogs. This is replaced by an empty string for public blogs.

<$BlogName$> : This tag corresponds to the name of the blog.

<$ArchiveDay$> : This tag is replaced by the name of the archive day.

<$ArchiveMonth$> : This tag is replaced by the name of the archive month.

<$ArchiveYear$> : This tag is replaced by the name of the archive year.

<$BlogBaseURL$> : This tag is replaced by the URL to the blog folder.

<$ContentAreaWidth$>, <$NavigationAreaWidth$> : These tags are used to control the width of the content and navigation columns. These tags are valid in all the template pages and their value is set in the General Preferences of iBlog.

<ArchiveList>, </ArchiveList> : These tags are used to enclose the list of entry titles in the day page.

<$ArchiveLink$> : This tag is replaced by a link to the entry page.

<$ArchiveTitle$> : This tag is replaced by the title of the entry.

<$NavigationItems$> : This tag is replaced by the text formed by joining together all the navigation item's headers and contents in the Navigation Editor.

<$DayEntriesCount$> : This tag is replaced by the number of entries in this day for the corresponding month, year and blog. <$Username$> : This tag is replaced by the name specified in the General Preferences.

Custom HomePage Template

To create a custom HomePage template create a new file named "HomePage.txt" in the folder ~/Library/iBlog/TemplateSets. Home page displays a list of all the blogs and their descriptions. Note that the Homepage is common to all the blogs.

Template Tags in HomePage.txt
<$BannerTitle$> : This tag is replaced by the "Homepage Banner" text set in the General Preferences.

<$BannerColor$> : This tag is replaced by the HTML color code for the color set for the "Homepage Banner Background" in the General Preferences.

<$TitleColor$> : This tag is replaced by the HTML color code for the color set for the "Homepage Banner Text Color" in the General Preferences.

<ForEachBlog> , </ForEachBlog> : This tag set encloses the list of blogs and their descriptions.

<$BlogName$> : This tag is used inside the ForEachBlog tag set and is replaced by the name of the blog.

<$BlogDescription$> : This tag is used inside the ForEachBlog tag set and is replaced by the description of the blog.

Custom FeedPage Template

To create a custom FeedPage template create a new file named "FeedPage.txt" in the folder ~/Library/iBlog/TemplateSets. Feed page displays a list of all the entries in a blog in a XML file format (RSS). Note that the Feedpage is common to all the blogs.

Template Tags in FeedPage.txt
<$BlogName$> : This tag is replaced by the name of the blog.

[$DocumentRoot$] : This tag is replaced during the Publish operation by the "Website URL" in Publish Preferences.

[$DatePublished$] : This tag is replaced during the Publish operation by the current date.

<$BlogDescription$> : This tag is replaced by the description of the blog.

<$AuthorEmail$> : This tag is replaced by the Email in the General Preferences.

<$Username$> : This tag is replaced by the Name in the General Preferences.

<$DateBuild$> : This tag is replaced by the date when the feed file is generated.

<$iBlogVersion$> : This tag is replaced by the current iBlog version string.

<ForEachEntry>, </ForEachEntry> : These tags are used to enclose the content of the entries in a feed.

<$EntryTitle$> : This tag is used inside the ForEachEntry tag set and is replaced by the entry title.

<$EntryLink$> : This tag is used inside the ForEachEntry tag set and is replaced by the entry URL.

<$EntryAbstract$> : This tag is used inside the ForEachEntry tag set and is replaced by the entry abstract.

<$EntryPostDate$> This tag is used inside the ForEachEntry tag set and is replaced by the entry post date.