The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.
Displays subcategories.
PARAMETERS (All optional):
1) parent - parent category id. Pipe is supported e.g. parent=“3|16|28”.
2) sibling - child category id (plugin will find parent).
3) category_group - category group id or name (highest level categories of that category
group will be treated by plugin as parent categories).
Either “parent” or “sibling” or “category_group” MUST BE defined.
4) weblog - weblog name. Pipe and “not” supported.
5) site
6) parent_categories_sort_by - for use with “category_group” parameter. Values: “name”, “id” and “custom”.
7) parent_categories_sort_direction - used with “category_group” parameter. Accepts values “asc” and “desc”. Default “asc”.
8) child_categories_sort_by - values: “name”, “id” and “custom” (children will be sorted using custom order as defined in control panel). Default “name”.
9) child_categories_sort_direction - values: “asc” and “desc”. Default is “asc”.
10) show_empty - specify if child categories having no entries should be displayed. Accepts values “yes” and “no”. Default “no”.
11) entries_sort_by - values: “title” and “date”. Default “date”.
12) entries_sort_direction - values: “asc” and “desc”. Default is “desc”.
13) entries_limit - how many entries posted into child category should be displayed. Accepts as its value an integer or “none”. Default is “10”. Value “none” means that all entries will be displayed.
14) date_format - PHP date format string (Not ExpressionEngine’s date format string!). Default is “Y-m-d”.
15) show_expired - values: “yes” and “no”. Default “yes”.
16) status - status of entries. “not” and pipe supported.
17) invalid_input - 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 such in cases plugin finishes its work without any alert being shown. Default is “silence”.
18) custom_field_name - used with “custom_field_value” parameter to display child categories with specific category custom field equal, not equal or like to specific value.
19) custom_field_value
20) custom_field - values: “include”, “exclude”, “like”. Used to display child categories with specific category custom field equal *not* equal or *like* to specific value. Default is “include”.
VARIABLE PAIRS:
1) {parent_category_start}{parent_category_end} - wraps code which will be iterated for each parent. Single vars:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
{parent_category_total}
2) {child_category_start}{child_category_end} - wraps code which will be iterated for each child. Single vars:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
{parent_category_total}
{child_category_id}
{child_category_name}
{child_category_url_title}
{child_category_description}
{child_category_image}
{child_category_order_num} - outputs number used for custom ordering of categories.
{child_category_count}
{entries_total}
3) {entries_start}{entries_end} - wraps code which will be iterated for each entry posted into child category. Single vars:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
{parent_category_total}
{child_category_id}
{child_category_name}
{child_category_url_title}
{child_category_description}
{child_category_image}
{child_category_order_num}
{child_category_count}
{entries_total}
{weblog_name}
{weblog_short_name}
{weblog_url}
{title}
{url_title}
{entry_date}
{entry_id}
{count}
4) {entries_wrapper_top_start}{entries_wrapper_top_end} - top part of the code with which you may want to wrap output of {entries_start}{entries_end} variable pair. Single vars:
{entries_total}
{child_category_id}
5) {entries_wrapper_bottom_start}{entries_wrapper_bottom_end} - bottom part of the code with which you may want to wrap output of {entries_start}{entries_end} variable pair. Single vars:
{entries_total}
{child_category_id}
6) {child_wrapper_bottom_start}{child_wrapper_bottom_end} - bottom part of the code with which you may want to wrap all data of child category. Single vars:
{entries_total}
{child_category_id}
7) {parent_wrapper_bottom_start}{parent_wrapper_bottom_end} - bottom part of the code with which you may want to wrap all data of parent category. Single vars:
{parent_category_children_count}
{parent_category_id}
The tag {exp:child_categories} MUST contain at least one variable pair out of
{parent_category_start}{parent_category_end}, {child_category_start}{child_category_end} and {entries_start}{entries_end} variable pairs and each single variable MUST BE inside relevant variable pair.
EXAMPLE OF USAGE:
{exp:child_categories parent="18|29" child_categories_sort_by="custom" child_categories_sort_direction="asc" show_empty="yes" entries_sort_by="date" entries_sort_direction="asc" entries_limit="3" site="1"}
{parent_category_start}
<h1><a href="{homepage}/category/{parent_category_url_title}/">{parent_category_name}</a></h1>
{parent_category_end}
{child_category_start}
<h2><a href="{homepage}/category/{child_category_url_title}/">{child_category_name}</a></h2>
Total entries: {entries_total}<br>
{child_category_end}
{entries_wrapper_top_start}<ul>{entries_wrapper_top_end}
{entries_start}
<li><a href="{weblog_url}{url_title}/">{title}</a> Weblog: {weblog_name}, posted: {entry_date}</li>
{entries_end}
{entries_wrapper_bottom_start}</ul>{entries_wrapper_bottom_end}
{/exp:child_categories}
