Category ID

Developer

Laisvunas

3rd Party (Commercial)


EE Version Support

  • ExpressionEngine 1.x
  • ExpressionEngine 2

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

Category ID allows you to find the Category ID number by submitting category group id and category url_title.

PARAMETERS:

1) category_group - Required. Allows you to specify ID number of category group
(the ID number of each category group is displayed in the Control Panel).
Also you can use category group name as specified in Control Panel. Pipe character can be used inside the value of this parameter
to specify several category groups. In case you use pipe character, make sure category url titles
are unique.

2) category_url_title - (any string which consists from characters legal for use in url segment). Required.
Allows you to specify URL title of the category.

3) on_failure - (any string which consists from characters legal for use in ExpressionEngine’s tag parameter
values). Optional. Allows you to specify what {exp:category_id} tag will output in case category group or
category url title specified in parameters does not exist.

4) 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.

EXAMPLE OF USAGE:

If URL title of your category is “my_category” and id number of it’s category group is “5” 
then the code

{exp:category_id category_group="5" category_url_title="my_category"}
{category_id}
{/exp:category_id}

will return id of the category which belongs to category group 5 and has URL title “my_category”.

You can use output of {category_id} variable
as parameter of other tag. For such use
you must add parse=“inward” parameter to {exp:category_id} tag.

For example, code as this will work

{exp:category_id category_group="5" category_url_title="{segment_3}" parse="inward"}
{exp:weblog:category_archive weblog="my_weblog" show="{category_id}"}
Some code
{/exp:weblog:category_archive}
{/exp:category_id}

If category group or category url title specified in parameters does not exist then the tag {exp:category_id}
by default will return nothing. In case ‘on_failure’ parameter was defined, then, in such case
the tag will output what was specified as value of this parameter.

Conditionals inside {exp:category_id} tag are supported. You can use conditionals to check if
category exists:

{exp:category_id category_group="5" category_url_title="{segment_3}"}
{if category_id!=""}
Some code
{if:else}
Another code
{/if}
{/exp:category_id}

Category ID Links

This entry was created June 8, 2009, 12:25 pm.
This entry was last updated December 31, 2010, 4:34 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!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

3 Reviews:

LimeRed Studio 04.24.13

LimeRed Studio
Rating - {addon_rating_average}

great plugin, works as expected and allows a little extra versatility where seg2cat doesn’t.

angieriver 01.11.12

angieriver
Rating - {addon_rating_average}

Thank you this worked perfect with freebie.

Lee 02.01.11

Lee
Rating - {addon_rating_average}

Thank you for this, works beautifully.