Michael Rog presents

RogEE: Add-ons for ExpressionEngine 2

Category Sorted Entries Lite

Like the built-in EE Category Archive, but way mo' better (i.e. with additional variables and parameters for added control).

(The newer, 2.0 version of Category Sorted Entries is available as a free download. It features even more parameters, more variables — including Custom Channel Fields, much better control over the listing output, and generally faster, cleaner code. This original 1.0 version is no longer in development and remains here for posterity as a much less full-featured alternative.)

Once upon a time, I wanted to select all my entries with a particular category from Category Group 1, but I wanted to display them in a nested list that included only categories from Category Group 2. I also needed to display the entry_id alongside the title of the entry. The standard Category Archive Tag was close, but didn't quite cut it; So, I wrote this plugin...

Examples: General Use

{exp:category_sorted_entries channel="test" style="nested" show_empty="no" group_id="2" category="not 2|3"}

{categories}
<h3>{category_name} ({category_id})</h3>
{/categories}

{entry_titles}
<p>{title} ({entry_id})</p>
{/entry_titles}

{/exp:category_sorted_entries}

{exp:category_sorted_entries channel="test" style="linear" show_empty="no" group_id="not 2" entry_id="1|2|3|4|5"}

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

{entry_titles}
<p>{title}</p>
{/entry_titles}

{/exp:category_sorted_entries}

Parameters

Note: The group_id, entry_id, and category parameters can accept multiple IDs, pipe-separated, and optionally can include a not trigger. (e.g. "1", "2|3|5", "not 2", and "not 3|4|6" are all valid.)

Variables

All the variables of the standard Category Archive Tag are available.

Additionally, in the {entry_titles} variable pair, the following additional variables can be used: