Weblog Module Tags

The Weblog Module of ExpressionEngine has several individual tags available for use. Each of the tags is explained in a separate section.

Entries

ExpressionEngine uses a single weblog tag to display both multi-entry and single-entry content. Further, this same tag is used to show entries from specific categories, monthly archives, permalinks, and more. This is a departure from what was used in pMachine Free and Pro if you are migrating from one of those programs. Example:

{exp:weblog:entries weblog="news" limit="15"}

<h3>{title}</h3>

{body}

<div>Last updated on {edit_date format='%M %d, %Y'} at {edit_date format='%h:%i %A'}<br />

Category:
{categories}
<a href="{path=archives}">{category_name}</a>  
{/categories}
</div>

{/exp:weblog:entries}

The weblog entries tag has a variety of parameters that can be added to affect what entry or entries are show as well as how they are displayed.

Further, inside of the tag you can use a number of variables to display different information such as entry title, date, body, etc.

Archive Month Links

The archive month links tag is used to display a list of months in which an entry was made in a weblog. Links allow you to view all the entries from the requested month. Example:

{exp:weblog:month_links weblog="news" limit="50"}

<a href="{path=weblog/index}">{month}, {year}</a><br />

{/exp:weblog:month_links}

Calendar

The calendar tag is used to display a calendar which contains links based on entries in your weblog. Example:

{exp:weblog:calendar switch="calendarToday|calendarCell"}

<table class="calendarBG" border="0" cellpadding="6" cellspacing="1" summary="My Calendar">
<tr class="calendarHeader">
<th><div class="calendarMonthLinks"><a href="{previous_path=weblog/index}">&lt;&lt;</a></div></th>
<th colspan="5">{date format="%F %Y"}</th>
<th><div class="calendarMonthLinks"><a class="calendarMonthLinks" href="{next_path=weblog/index}">&gt;&gt;</a></div></th>
</tr>
<tr>
{calendar_heading}
<td class="calendarDayHeading">{lang:weekday_abrev}</td>
{/calendar_heading}
</tr>

{calendar_rows }
{row_start}<tr>{/row_start}

{if entries}
<td class='{switch}' align='center'><a href="{day_path=weblog/index}">{day_number}</a></td>
{/if}

{if not_entries}
<td class='{switch}' align='center'>{day_number}</td>
{/if}

{if blank}
<td class='calendarBlank'>&nbsp;</td>
{/if}

{row_end}</tr>{/row_end}
{/calendar_rows}
</table>
{/exp:weblog:calendar}

Categories

Lists of weblog categories can be displayed using the weblog categories tag. Example:

{exp:weblog:categories}

<a href="{path=weblog/index}">{category_name}</a>

{/exp:weblog:categories}

Category Archive Listing

The category archive tag is designed to let you list all of your weblog entries and have them organized by category. Example:

{exp:weblog:category_archive weblog="news" backspace="6"}

{categories}
<h3>{category_name}</h3>
{/categories}

{entry_titles}
<a href="{path=SITE_INDEX}">{title}</a><br />
{/entry_titles}

{/exp:weblog:category_archive}

Category Heading

The purpose of the category heading tag is to show the currently viewed category as a heading. This tag is generally used on your main entries page where your Category Archive List tag points. Example:

{exp:weblog:category_heading}

<h2>{category_name}</h2>

{/exp:weblog:category_heading}

Next/Prev Entry Linking

The Next and Previous entry links tag allow you to automatically generate links to the next or previous entry. They are often used when displaying a single entry to provide navigation to other entries. Example:

<p>
{exp:weblog:prev_entry}
Previous entry: <a href="{path="weblog/comments"}">{title}</a>
{/exp:weblog:prev_entry}

| Navigation |

{exp:weblog:next_entry}
Next entry: <a href="{path="weblog/comments"}">{title}</a>
{/exp:weblog:next_entry}
</p>

Related Entries

The related entries tag allow you to show a list of other entries that belong to the same category as the currently viewed entry. Example:

{exp:weblog:related_entries limit="10" backspace="6"}

<a href="{comment_path=weblog/index}">{title}</a><br />

{/exp:weblog:related_entries}

Weblog Name

The name of a weblog can be displayed using the weblog name tag. Example:

{exp:weblog:weblog_name weblog="news"}