Compatibility
The download contains both the EE1 and EE2 version. Note: the EE1 compatible
version uses the tag {exp:yearly_archives:…}.
Installation
ExpressionEngine 2
- Download and unzip Low Yearly Archives
- Copy the
ee2/low_yearly_archives folder to your /system/expressionengine/third_party/ directory
- All set!
ExpressionEngine 1
- Download and unzip Low Yearly Archives
- Copy the
ee1/pi.yearly_archives.php file to your /system/plugins/ directory
- All set!
Parameters for {exp:low_yearly_archives} tag pair
| Parameter |
Description |
channel |
The name of the channel you want to limit the query to. Use weblog in EE1. |
status |
You may restrict to entries with a particular status. |
show_expired |
You can determine whether you wish for entries that have “expired” to be included. |
show_future_entries |
You can determine whether you wish for entries dated in the “future” to be included. |
sort |
The sort order of the years can be ascending (asc) or descending (desc). |
monthsort |
The sort order of the months can be ascending (asc) or descending (desc) |
start_month |
Number of the month the archives should start with. Defaults to the month of the oldest entry. |
end_month |
Number of the month the archives should end with. Defaults to the month of the newest entry. |
start_year |
The year the archives should start with. Defaults to the year of the oldest entry. |
end_year |
The year the archives should end with. Defaults to the year of the newest entry. |
site_id |
The id of the site from which to pull the data. Defaults to the current site. |
Variables for {exp:low_yearly_archives} tag pair
| Variable |
Description |
{year} |
The 4-digit year. |
{year_short} |
The 2-digit year. |
{year_count} |
Count of the number of years in the archives. |
{total_years} |
Total amount of years in the archives. |
{leap_year} |
Set to TRUE when given year is a leap year. |
{entries_in_year} |
Amount of entries posted in given year. |
{months}{/months} |
Variable pair to loop through the months of a year. This variable pair allows the parameter backspace. |
{month} |
Full name of month. Only available inside the {months} variable pair. |
{month_num} |
The number of month, with leading zero. Only available inside the {months} variable pair. |
{month_num_short} |
The number of month, without leading zero. Only available inside the {months} variable pair. |
{month_count} |
Count of the number of months in a year. Only available inside the {months} variable pair. |
{total_months} |
Total amount of months in a year. Only available inside the {months} variable pair. |
{num_entries} |
Amount of entries posted in month. Only available inside the {months} variable pair. |
{num_entries_percentage} |
Percentage of entries posted in month. Only available inside the {months} variable pair. |
{num_entries_percentage_rounded} |
Rounded percentage of entries posted in month. Only available inside the {months} variable pair. |
Examples
ExpressionEngine 2
{exp:low_yearly_archives channel="blog" start_month="1" status="not closed" sort="desc"}
{if year_count == 1}<ul>{/if}
<li>
{year}
<ul>
{months}
<li>
{if num_entries != 0}
<a href="{path=blog/archive}{year}/{month_num}/"
title="{num_entries} entries in {month} {year}">{month_short}</a>
{if:else}
{month_short}
{/if}
</li>
{/months}
</ul>
</li>
{if year_count == total_years}</ul>{/if}
{/exp:low_yearly_archives}
ExpressionEngine 1
{exp:yearly_archives weblog="blog" start_month="1" status="not closed" sort="desc"}
{if year_count == 1}<ul>{/if}
<li>
{year}
<ul>
{months}
<li>
{if num_entries != 0}
<a href="{path=blog/archive}{year}/{month_num}/"
title="{num_entries} entries in {month} {year}">{month_short}</a>
{if:else}
{month_short}
{/if}
</li>
{/months}
</ul>
</li>
{if year_count == total_years}</ul>{/if}
{/exp:yearly_archives}