EllisLab text mark
Advanced Search
     
New module: {exp:categories} tag for EE 2.0
Posted: 10 April 2010 09:37 AM   [ Ignore ]
Avatar
Joined: 2007-02-11
546 posts

What does it do?

Adds an extra tag called {exp:categories} that, unlike {exp:channel:categories} can get category information without being tied to a channel.

This way you can let a client edit categories (lists basically) which you use in form dropdowns, etc.

Parameters

* category_group_id (required) the group id of the category to get
* url_title (optional) if specified the tag will only get information about a specific category (with that url_title)

Variables

  * {category_name}
  * {category_url_title}
  * {category_image}

Usage example

This example will populate a dropdown list using the categories in group_id 4:

{exp:categories category_group_id="4"<option value="{category_url_title}">{category_name}</option{/exp:categories} 

And this will populate a form with some hidden values pointing to category images:

{exp:categories category_group_id="4"<input type='hidden' name='{category_url_title}_logo' value='{category_image}'/> {/exp:categories} 


Downloads & docs:

http://ee.bybjorn.com/categories/

 Signature 

bybjorn.com: ExpressionEngine Freelancer - Premium ExpressionEngine 2.0 Themes - WDA: ExpressionEngine Add-ons - contact me on twitter: twitter.com/bjornbjorn - Zerply profile: zerp.ly/bjornbjorn

 
Posted: 10 April 2010 01:12 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-11-11
635 posts

Very useful - thanks. I was trying to get round this limitation a few weeks back!

 
Posted: 11 April 2010 07:34 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2009-09-15
52 posts

Thanks Bjørn, sure is going to be handy when moving over to EE2.

 Signature 

A lover of good thinking, great music and EE.