EE 1
EE 2
Entry Category Count

Developer

Focus Lab, LLC - Erik Reagan

3rd Party (Free)

Creative Commons Attribution Share Alike

Compatibility

  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Better Workflow
  • Matrix

Requirements

  • jQuery for the Control Panel

Categories

Plugin

Tags

Occasionally you want to only display something based on the number of categories that is assigned to a particular entry. This is a small plugin that grabs that number and allows the use of it in conditional statements.

Sample Usage:

Total Assigned Categories: {exp:entry_category_count entry_id="{entry_id}"} 
{if {exp:entry_category_count entry_id="{entry_id}"} > 1}
  There are multiple categories assigned to this entry
{/if} 
{if {exp:entry_category_count entry_id="{entry_id}"} == 0}
  There are no categories assigned to this entry
{/if} 

You can hardcode in an entry ID if you like

{if {exp:entry_category_count entry_id="124"} > 1}
  Your very awesome code here
{/if} 

Entry Category Count Links

This entry was created February 8, 2010, 6:57 am.
This entry was last updated March 27, 2010, 12:30 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!

1 Review:

Jérôme Coupé 06.24.11

Rating - {addon_rating_average}

Does what is says. Very useful in some cases. I needed it for EE2, so I have ported it. Reviewed by Erik https://github.com/jeromecoupe/jco_entry_catcount