Hi,
I would like to present to your attention a new plugin: Entries List.
This plugin allows you to find titles, url_titles, weblog names, weblog short names, weblog urls and category names of all entries posted to certain weblogs and/or to certain categories.
PARAMETERS:
1) category - Optional. Allows you to specify category id number
(the id number of each category is displayed in the Control Panel).
You can stack categories using pipe character to get entries
with any of those categories, e.g. category=“3|6|8”. Or use “not”
(with a space after it) to exclude categories, e.g. category=“not 4|5|7”.
2) weblog - Optional. Allows you to specify weblog name.
You can use the pipe character to get entries from any of those
weblogs, e.g. weblog=“weblog1|weblog2|weblog3”.
Or you can add the word “not” (with a space after it) to exclude weblogs,
e.g. weblog=“not weblog1|weblog2|weblog3”.
At least one out of “category” and “weblog” parameters must be defined.
3) sort - Optional. Allows you to specify sort order. Entries are sorted by date.
Sort order can be ascending (sort=“asc”) or descending (sort=“desc”).
If this parameter is not defined, then entries are sorted ascendingly
for each weblog separately, if defined, then all entries are sorted
together.
4) site - Optional. Allows you to specify site id number.
You can stack site id numbers using pipe character to get entries
from any of those sites, e.g. site=“1|3”. Or use “not”
(with a space after it) to exclude sites, e.g. site=“not 1|2”.
5) limit - Optional. Allows you to specify number of entries to be displayed.
6) invalid_input - Optional. Accepts two values: “alert” and “silence”.
Default value is “silence”. If the value is “alert”, then in cases when some
parameter’s value is invalid plugin exits and PHP alert is being shown;
if the value is “silence”, then in cases when some parameter’s value
is invalid plugin finishes its work without any alert being shown.
Set this parameter to “alert” for development, and to “silence” - for deployment.
7) aliases_only - Optional. Accepts two values: “yes” and “no”. Default value is “no”.
If the value is “yes”, then variables {title}, {url_title} and {category_name} will not be parsed by the plugin; only their aliases will be parsed. If the value is “no”, then
both variables {title}, {url_title} and {category_name} and their aliases will be parsed. Set this parameter to “no” and use only aliases if you include {exp:entries_list} tag inside some other tag (e.g exp:weblog:entries) which parses these variables.
8) on_failure - Optional. Allows you to specify what exp:entries_list tag
should output in case no entry was found. By default the tag in such case
will output nothing. If you set some string as the value of this parameter,
then that string will be outputted. If you set “tagdata” as the value of
this parameter, then the tag will output unmodified tagdata.
VARIABLES:
1) {weblog_name} - outputs the name of the weblog into which an entry was
posted.
2) weblog_short_name - outputs short name of the weblog into which an entry was
posted.
3) {weblog_url} - outputs weblog url as specified in weblog preferences.
4) {url_title} - outputs url title of the entry. Alias of this variable is {entries_list_url_title}.
5) {category_name} - outputs category name into which entry was posted.
(Only those category names will be displayed which satisfy condition
set in “category” parameter.) Alias of this variable is {entries_list_category_name}.
6) {title} - outputs title of entry. Alias of this variable is {entries_list_title}.
7) {entry_id} - outputs entry id number of the entry. Alias of this variable
is {entries_list_entry_id}
EXAMPLE OF USAGE:
{exp:entries_list category="6" weblog="not weblog1|weblog4" sort="asc" site="1"}
{if weblog_short_name=="weblog3"}
<a href="{weblog_url}{url_title}">{title}</a><br>
{if:else}
<a href="{weblog_url}{url_title}">{category_name}: {title}</a><br>
{/if}
{/exp:entries_list}
Place this tag in any of your templates.
You may ask: if there is a need to find titles, url_titles etc. of entries posted into certain categories or into certain weblogs, why not use {exp:weblog:entries} tag or {exp:weblog:category_archive} tag?
Here is why:
1) using {exp:weblog:entries} you can easily exhaust PHP memory limit if you need to display titles, url_titles etc. of many entries.
2) {exp:weblog:category_archive} tag consumes less PHP memory, but it allows only to search for entries through one weblog.
3) {exp:weblog:entries} tag does not allow to pull weblog url which is specified in weblog preferences. Instead you must use {path=template_group/template} variable. This is very constricting if you need to pull entries from several weblogs and display them using different templates.
Entries list plugin deals with these shortcommings of {exp:weblog:entries} and {exp:weblog:category_archive} tags and allows you to build easily menus and tables of contents displaying entries belonging to certain weblogs and posted into certain categories.
Changelog:
-1.7 // Added on_failure parameter.
-1.6 // Bug fixed - uncategorized entries not being shown. Added variable {entry_id} and its alias {entries_list_entry_id}.
-1.5 // Added support for conditionals and variable “weblog_short_name”.
-1.4 // Added “aliases_only” parameter and aliases to {title}, {url_title} and {category_name} variables.
-1.3 // Added invalid_input parameter.
-1.2 // Added limit parameter.
-1.1 // Bug fixed - weblog_name variable displying weblog short name instead of full weblog name. Added “site” parameter. “Category” parameter made optional. Plugin’s name changed from “Category posts” to “Entries list”.
-1.0 // Initial release.
