SiteDrop

SiteDrop is a special Liquid drop representing the site. It contains some useful methods you may want to use in your templates.

An instance of SiteDrop is available throughout all templates in the variable site.

Methods

SiteDrop supports the following methods:

controller
Returns the name of the current controller (for example, "blog").
action
Returns the name of the current action (for example, "show").
latest_entries
Returns an array of the latest entries.
Set the attribute limit to limit the amount entries returned. Default is 5.
latest_comments
Returns an array of the latest comments.
Set the attribute limit to limit the amount comments returned. Default is 5.
popular_tags
Returns an array of popular tags.
Set the attribute limit to limit the amount tags returned. Default is 10.
This array is sorted on popularity (the most popular tag at the top), and contains a set of hashes, with the following pairs:
- id: The tag id
- name: The tag name
- count: The amount of entries with that tag.
popular_entries
Returns an array of popular entries.
Set the attribute limit to limit the amount entries returned. Default is 10.
This array is sorted on comment count (the entry with the most comments and thus the most popular entry at the top). It contains a set of hashes, with the following pairs:
- entry: An EntryDrop representing the entry.
- comment_count: The amount of comments on that entry.
monthly_archives
Returns an array of year/month combinations with the amount of entries in that month.
This array is ordered chronologically, the first month is first in the array. It contains a set of hashes, with the following pairs:
- year: The year of the archive.
- month: The month of the archive.
- time: A Time object for the month and year. This can be used in conjunction with the date filter.
- count: The amount of entries published that month.
page_revision: 5, last_edited: 1180352376|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.