Pages

child category

EE 1
EE 2
Child Categories

Developer

3rd Party (Commercial)
Current Version: 3.1

Buy Now!

$20.00
Qty: 

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.
  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Displays a list of subcategories for given parent(s).
PARAMETERS:
  1) parent - Optional. Allows you to specify parent category id number
  (the id number of each category is displayed in the Control Panel).
  You can stack parent categories using pipe character e.g. parent=“3|16|28”.
You also can use operator “not” to exclude certain parent categories.
 
  NOTICE: In case you use operator “not” the parameter “category_group” must be defined.
  2) sibling - Optional. Allows you to specify child category id number
  (the id number of each category is displayed in the Control Panel).
  3) category_group - Optional. Allows you to specify category group id number
  (the id number of each category group is displayed in the Control Panel) or
  category group name. In case this parameter is defined, all highest level
  categories of that category group will be treated by plugin as parent categories.
  Either “parent” or “sibling” or “category_group” parameter MUST BE defined.
  4) weblog - Optional. Use it to specify weblog name.
  Pipeline character and “not” are supported.
 
  5) channel - Optional. For EE2.x only. Use it to specify channel name.
  Pipeline character and “not” are supported.
  6) site - Optional. Allows you to specify site id number.
  7) parent_categories_sort_by - Optional. For use together with “category_group”
  parameter. Allows you to specify sort order
  of parent categories. This parameter accepts three values: “name” (parent
  categories will be sorted by name), “id” (parent categories will be sorted
  by id number), and “custom” (parent categories will be sorted using custom order
  as defined in control panel). Default value is “name”.
  8) parent_categories_sort_direction - Optional. For use together with “category_group”
  parameter. Allows you to specify sort direction
  of parent categories. This parameter accepts two values: “asc” and “desc”.
  Default value is “asc”.
  9) child_categories_sort_by - Optional. Allows you to specify sort order
  of child categories. This parameter accepts three values: “name” (child
  categories will be sorted by name), “id” (child categories will be sorted
  by id number), and “custom” (child categories will be sorted using custom order
  as defined in control panel). Default value is “name”.
  10) child_categories_sort_direction - Optional. Allows you to specify sort direction
  of child categories. This parameter accepts two values: “asc” and “desc”.
  Default value is “asc”.
  11) show_empty - Optional. Allows you to specify if child categories having no
  entries should be displayed or not. This parameter accepts two values: “yes” and “no”.
  Default value is “no”.
  12) entries_sort_by - Optional. Allows you to specify sort order of entries.
  This parameter accepts two values: “title” and “date”. Default value is “date”.
  13) entries_sort_direction - Optional. Allows you to specify sort direction
  of entries. This parameter accepts two values: “asc” and “desc”.
  Default value is “desc”.
  14) entries_limit - Optional. Allows you to specify how many entries posted into
  child category should be displayed. This parameter accepts as its value an integer
  or “none”. Default value is “10”. Value “none” means that all entries will be
  displayed.
15) entries_start_on - Optional. You can specify a particular date/time on which to start the entries.
  Only entries that are on or after this date will be included in the display.
  The date/time must be specified in the following format: YYYY-MM-DD HH:MM
  Here, YYYY is the four-digit year, MM is the two-digit month, DD is the two-digit day of the month,
  HH is the two-digit hour of the day, and MM is the two-digit minute of the hour.
  If the month, day, hour or minute has only one digit, precede that digit
  with a zero. (E.g. “8.30 PM, March 9, 2004” would become “2004-03-09 20:30”.)
 
  16) entries_stop_before - Optional. You can specify a particular date/time on which to end the entries.
  Only entries that are before this date will be included in the display (entries exactly on this date/time will not be included).
  The date/time must be specified in the following format: YYYY-MM-DD HH:MM
  Here, YYYY is the four-digit year, MM is the two-digit month, DD is the two-digit day of the month,
  HH is the two-digit hour of the day, and MM is the two-digit minute of the hour.
  If the month, day, hour or minute has only one digit, precede that digit
  with a zero. (E.g. “8.30 PM, March 9, 2011” would become “2011-03-09 20:30”.)
  17) date_format - Optional. Allows you to specify PHP date format string
  (Not ExpressionEngine’s date format string!). Default value is “Y-m-d”.
  18) show_expired - Optional. Allows you to specify if you wish expired entries
  to be displayed. If the value is “yes”, expired entries will be displayed; if the
  value is “no”, expired entries will not be displayed. Default value is “yes”.
  19) status - Optional. Allows you to specify status of entries.
  You can stack statuses using pipe character to get entries
  having any of those statuses, e.g. status=“open|draft”. Or use “not”
  (with a space after it) to exclude statuses,
  e.g. status=“not submitted|processing|closed”.
  20) 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.
 
  21) custom_field_name - Optional. Used when there is a need to display child categories
  with specific category custom field equal to or not equal to or like
  specific value.
 
  22) custom_field_value - Optional. Used when there is a need to display child categories
  with specific category custom field equal to or not equal to or like specific value.
 
  23) custom_field - Optional. Used when there is a need to display child categories with specific category custom field
  *not* equal or *like* to specific value. Acceps the value “include”, “exclude” and “like” (only categories
  with custom_field_name LIKE custom_field_value will be displayed - SQL LIKE notation will be used).
  Default value is “include”.
24) aliases_only - Optional. Possible values are “yes” and “no” (default).
  If the value is yes the variables {weblog_short_name}, {channel_name}, {title},
  {url_title}, {entry_id}, {entry_date}, {count} are not parsed, only their aliases
  {child_categories_weblog_short_name}, {child_categories_channel_short_name}, {child_categories_entry_title},
  {child_categories_url_title}, {child_categories_entry_id}, {child_categories_entry_date}, {child_categories_entry_count} are parsed.
 
  25) child_category_switch - Optional. This parameter is used together with {child_category_switch} variable and permits you to rotate
  the latter through any number of values as the child categories are displayed. E.g. if you define child_category_switch=‘option_one|option_two|option_three’ then
  the first child category will use “option_one”, the second will use “option_two”, the third “option_three”, the fourth “option_one”, and so on.
 
  26) entry_switch - Optional. This parameter is used together with {entry_switch} variable and permits you to rotate
  the latter through any number of values as the entries are displayed. E.g. if you define entry_switch=‘option_one|option_two|option_three’ then
  the first entry will use “option_one”, the second will use “option_two”, the third “option_three”, the fourth “option_one”, and so on.
  VARIABLE PAIRS:
  1) {parent_category_start}{parent_category_end} - Allows you to specify portion of
  code which will be iterated as many times as there are parent categories.
  Single variables available for use inside this variable pair:
  {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}
{parent_category_entries_number}
  {category_group_id}
  {category_group_name}
  The values of custom category fields of the parent category can be outputted by prefixing string “parent_category_”
  to their names. E.g. if there is category custom field “editor_name”, then its value will be outputted by the variable
  {parent_category_editor_name}.
  2) {child_category_start}{child_category_end} - Allows you to specify portion of
  code which will be iterated as many times as there are child categories.
  Single variables available for use inside this variable pair:
  {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}
{parent_category_entries_number}
  {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}
  {category_group_id}
  {category_group_name}
{child_category_switch}
  The values of custom category fields of the parent category can be outputted by prefixing string “parent_category_”
  to their names. E.g. if there is category custom field “editor_name”, then its value will be outputted by the variable
  {parent_category_editor_name}.
  The values of custom category fields of the child category can be outputted by prefixing string “child_category_”
  to their names. E.g. if there is category custom field “contributors”, then its value will be outputted by the variable
  {child_category_contributors}.
  3) {entries_start}{entries_end} - Allows you to specify portion of
  code which will be iterated as many times as there are entries posted into child
  category. Single variables available for use inside this variable pair:
  {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}
{parent_category_entries_number}
  {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}
  {category_group_id}
  {category_group_name}
  {weblog_name}
  {weblog_short_name}
  {weblog_url}
  {channel_name} - for EE2.x only.
  {channel_short_name} - for EE2.x only.
  {channel_url} - for EE2.x only.
  {title}
  {url_title}
  {entry_id}
  {entry_date}
  {count}
{child_categories_weblog_short_name} - alias for {weblog_short_name}
  {child_categories_channel_short_name} - for EE2.x only. Alias for {channel_short_name}
  {child_categories_entry_title} - alias for {title}
  {child_categories_url_title} - alias for {url_title}
  {child_categories_entry_id} - alias for {entry_id}
  {child_categories_entry_date} - alias for {entry_date}
  {child_categories_entry_count} - alias for {count}
  {child_category_switch}
  {entry_switch}
  4) {entries_wrapper_top_start}{entries_wrapper_top_end} - Allows you to specify top part of
  the code with which you want to wrap output of {entries_start}{entries_end} variable pair.
  Single variables available for use inside this variable pair:
  {entries_total}
  {child_category_id}
  The values of custom category fields of the parent category can be outputted by prefixing string “parent_category_”
  to their names. E.g. if there is category custom field “editor_name”, then its value will be outputted by the variable
  {parent_category_editor_name}.
  The values of custom category fields of the child category can be outputted by prefixing string “child_category_”
  to their names. E.g. if there is category custom field “contributors”, then its value will be outputted by the variable
  {child_category_contributors}.
  5) {entries_wrapper_bottom_start}{entries_wrapper_bottom_end} - Allows you to specify bottom part of
  the code with which you want to wrap output of {entries_start}{entries_end} variable pair.
  Single variables available for use inside this variable pair:
  {entries_total}
  {child_category_id}
  6) {child_wrapper_bottom_start}{child_wrapper_bottom_end} - Allows you to specify bottom part of
  the code with which you want to wrap all data of child category.
  Single variables available for use inside this variable pair:
  {entries_total}
  {child_category_id}
  7) {parent_wrapper_bottom_start}{parent_wrapper_bottom_end} - Allows you to specify bottom part of
  the code with which you want to wrap all data of parent category.
  Single variables available for use inside this variable pair:
  {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.
  SINGLE VARIABLES:
  1) {parent_category_id} - outputs id number of parent category.
  2) {parent_category_name} - outputs name of parent category.
  3) {parent_category_url_title} - outputs url title of parent category.
  4) {parent_category_description} - outputs description title of parent category.
  5) {parent_category_image} - outputs url of the image of parent category.
  6) {parent_category_children_count} - outputs number of child categories of parent category.
  7) {parent_category_count} - outputs count number, i.e. 1, 2, 3, etc., of the
  parent category.
 
  8) {parent_category_total} - outputs number of parent categories.
9) {parent_category_entries_number} - outputs number of entries posted into parent category.
  9) {child_category_id} - outputs id number of child category.
  10) {child_category_name} - outputs name of child category.
  11) {child_category_url_title} - outputs url title of child category.
  12) {child_category_description} - outputs description title of child category.
  13) {child_category_image} - outputs url of the image of child category.
  14) {child_category_order_num} - outputs number used for custom ordering of
  categories.
  15) {child_category_count} - outputs outputs count number, i.e. 1, 2, 3, etc., of the
  child category. Empty child categories are counted in case “show_empty” parameter has the
  value “yes”.
  16) {entries_total} - outputs total number of entries posted into child category.
  17) {weblog_name} - outputs full weblog name into which entry is posted.
  18) {weblog_short_name} - outputs short weblog name into which entry is posted.
  19) {weblog_url} - outputs weblog url as specified in control panel.
 
  20) {channel_name} - (for EE2.x only) outputs full channel name into which entry is posted.
  21) {channel_short_name} - (for EE2.x only) outputs short channel name into which entry is posted.
  22) {channel_url} - (for EE2.x only) outputs channel url as specified in control panel.
  23) {title} - outputs title of entry.
  24) {url_title} - outputs url title of entry.
  25) {entry_date} - outputs entry date of entry.
  26) {count} - outputs order number of entry.
  27) {child_category_switch} - used together with “child_category_switch” parameter and rotates through the values of this parameter.
 
  28) {entry_switch} - used together with “entry_switch” parameter and rotates through the values of this parameter.
  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}< div style="border: 1px solid red;" >{entries_wrapper_top_end}
{entries_start}
<a href="{weblog_url}{url_title}">{title}</a> Weblog: {weblog_name}, posted: {entry_date}<br>
{entries_end}
{entries_wrapper_bottom_start}< /div >{entries_wrapper_bottom_end}
{/exp:child_categories}

This code will output:
Parent category 18
  Child category
  Total entries
    Entry
    Entry
    Entry
  Child category
  Total entries
    Entry
    Entry
    Entry
  Child category
  Total entries
    Entry
    Entry
    Entry
Parent category 29
  Child category
  Total entries
    Entry
    Entry
    Entry
  Child category
  Total entries
    Entry
    Entry
    Entry

Child Categories Links

This entry was created May 12, 2009, 11:44 am.
This entry was last updated January 14, 2014, 9:40 am.
Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

3 Reviews:

atomworks04.29.13

atomworks
Rating - {addon_rating_average}
Shows promise and handles basics but lacks the ability to be truly powerful. Feels like a plugin made for personal use just thrown on the market. Coding is sloppy so it’s hard to even implement changes yourself. Recommend looking elsewhere before purchasing.

Chris Arnold09.22.11

Chris Arnold
Rating - {addon_rating_average}
Pretty much perfect for when you need to display a loop of parent categories with children under them, whether it’s text links or something a little more substantial like product icons in my use case. Leaves me wondering why there isn’t EE native control like this.

Forrest06.08.11

Forrest
Rating - {addon_rating_average}
This is an absolutely indispensable add-on. Laisvunas knows his stuff and this add-on has not only saved hours of development time, but made it possible to do things that would otherwise be impossible. Well done!

0 comments:

Post a Comment