Displays list of subcategories for given parent(s).
PARAMETERS (All optional):
1) parent - parent category id. Pipe character supported e.g. parent=“3|16|28”.
2) sibling - child category id (plugin will find parent and other children).
3) category_group - category group id (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. Pipeline character and “not” are supported.
5) site
6) parent_categories_sort_by - for use together with “category_group” parameter. Accepts values “name”, “id” and “custom”.
7) parent_categories_sort_direction - for use together with “category_group” parameter. Accepts values “asc” and “desc”. Default is “asc”.
8) child_categories_sort_by - accepts values “name”, “id” and “custom” (children will be sorted using custom order as defined in control panel). Default is “name”.
9) child_categories_sort_direction - accepts 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 is “no”.
11) entries_sort_by - accepts two values: “title” and “date”. Default is “date”.
12) entries_sort_direction - accepts 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 - accepts values “yes” and “no”. Default is “yes”.
16) status - status of entries. “not” and pipe characters are 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”.
VARIABLE PAIRS:
1) {parent_category_start}{parent_category_end} - wraps code which will be iterated for each parent. Single variables:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
2) {child_category_start}{child_category_end} - wraps code which will be iterated for each child. Single variables:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
{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 variables:
{parent_category_id}
{parent_category_name}
{parent_category_url_title}
{parent_category_description}
{parent_category_image}
{parent_category_children_count}
{parent_category_count}
{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 variables:
{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 variables:
{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 variables:
{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 variables:
{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}
