We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Top Categories

Development and Programming

Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.

The purpose of this plugin is to display a list of top categories, i.e. of categories into which more entries are posted than in other categories.

PARAMETERS

1) limit - Optional. Allows you to specify hown many top categories should be dispayed. Default value is “3”.

2) site - Optional. Allows you to specify site id number. Default value is “1”.

3) weblog - Optional. Use it to specify weblog name. Pipeline character and “not” are supported.

4) category_id - Optional. Allows you to specify which categories should be dispayed. Pipeline character and “not” are supported.

5) group_id - Optional. Allows you to specify category group id number (the id number of each category group is displayed in the Control Panel). Pipeline character and “not” are supported.

6) 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”.

7) count_expired - Optional. If you want that expired entries should be counted, set the value of this parameter to “yes”. Default value is “no”.

8) lowest_level_only - Optional. If set to “yes”, then only those categories will be displayed, which have no children. Default value is “no”.

VARIABLES

1) top_cats_cat_id - outputs category id number.

2) top_cats_cat_name - outputs category name.

3) top_cats_cat_image - outputs URL of category image.

4) top_cats_group_id - outputs category group id.

5) top_cats_parent_id - outputs id of parent category.

6) top_cats_cat_url_title - outputs category URL title.

7) top_cats_cat_description - outputs category desciption.

8) top_cats_entries_number - outputs number of entries posted into category.

USAGE

Use this plugin as folllows:

{exp:top_categories limit="5" weblog="not common|blog" category_id="not 6|52|178|54|169" group_id="3|45" status="open|draft" count_expired="yes"}
Category name: {top_cats_cat_name}, entries number: {top_cats_entries_number}, category id: {top_cats_cat_id}, parent category id: {top_cats_parent_id}, cat_url_title: {top_cats_cat_url_title}, group id: {top_cats_group_id}


{/exp:top_categories}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.