New FieldFrame field type - SC Category Select
Posted: 24 February 2010 07:12 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  155
Joined  03-17-2008

Hi all,

SC Category Select is a Pixel&Tonic;‘s FieldFrame FieldType which displays selected category options in a drop-down list. It only allows selection of a single category. You can select multiple category groups. The FieldType respects sub-categories.

The category id is saved - not the category name - however you can display the heading, description and url_title using some custom functions. See “Usage” in the documentation for details.

On saving an entry, the ‘real’ category will be automatically selected as well, for ALL SC Category Select fields listed on the publish form… even those in a FF Matrix. This allows template interaction with the fieldtype tag, and the use of normal category tags. It also has the added benefit of allowing you to use the category search in the CP Edit tab.

The current version is 1.1.

So where to find out more and download the extension:

Download from GitHub - http://github.com/agun/SC-Category-Select
Find it on the Devot-ee site - http://devot-ee.com/add-ons/extensions/sc-category-select/
Personal site - http://www.sassafrasconsulting.com.au/software/category-select/

Don’t hesitate to leave me a comment or question!

 Signature 

WebFreelancers - Permanent and Freelance Web Design/Development Jobs - Built on EE
(Previously known as ‘agun’)

Profile
 
 
Posted: 24 February 2010 08:41 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  92
Joined  07-31-2008

This is exactly something I have needed for some time!

I had one huge category group that I broke down in to 5 different category groups. With this extension I was able to use FF Matrix to list each of these category groups within my edit and publish page.

This is a must if you have large Category lists.

Works great! Thanks

Mike

Profile
 
 
Posted: 26 April 2010 11:21 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  489
Joined  07-04-2007

I am getting errors when i try to use :url_title :heading and :description in my templates

MySQL ERROR:

Error Number1064

Description
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1

Query
SELECT cat_url_title FROM exp_categories WHERE cat_id LIMIT 1 

ExpressionEngine 1.6.8
Build:  20091002
FeildFrame 1.4

This only happens when the the field is blank, it seems it still tries to run the query with a blank category id.

adding something like this to the start of the get_category_data function would be a quick fix:

if (!$field_data){
return;
Profile
 
 
Posted: 12 May 2010 10:31 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  652
Joined  07-18-2006

Hi agun,

Is there any way to have this not over-write the existing category choices, just to add this one to any additional ones that are there?  I’ve a need to allow someone to select any number of categories, but also need to be able to select one as the primary category with this fieldtype.  I have been using for a while not realizing it over-wrote the other category choices until just now…

Thanks for any help!

Profile
 
 
Posted: 12 May 2010 10:39 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  489
Joined  07-04-2007

I experimented with using this is a Matrix field to create a primary category.

This will allow you to create as many categories as you want (new row for each category, and you can set a limit if you wish), and in your templates you can use the first item in the matrix as the primary, or even have it as it’s own field.

I’m not quite sure what happens when you delete categories from the backend though, as you might run into situation when the category is stored in the field but doesn’t exist in the database.

The other option is solspaces primary category:
http://www.solspace.com/software/detail/primary_category/

Profile
 
 
Posted: 20 May 2010 01:07 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  166
Joined  02-27-2004

Agun,

I second Brian M.‘s ideas about not over-writing the category selected in Categories, when you make a choice in a custom SC Category Select field. It would be really nice if a custom SC Category Select field could either

1) append the categories selected in the field to the entry’s categories
2) simply contain the Category ID of the selection, and didn’t change the entry’s categories at all.

Is it a pipe dream to ask for a choice of behaviour of the field? That would be soooo sweet.

As it is, I can’t really use it for the project I want to use it for — I’d like to be able to do one or both of these things with a Category Select custom field — especially for aesthetic purposes in the Publish/Edit form. It works really beautifully, otherwise!

Cheers

R o B

Profile
 
 
Posted: 24 May 2010 11:12 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  12-13-2007

When using this, the nesting nbsp;‘s get output as @nbsp@ in the select options. Anyone know why?

 Signature 

Fusionary | Geniuscar

Profile
 
 
Posted: 30 June 2010 07:22 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Avatar
Total Posts:  17
Joined  03-14-2008

Hi Agun,

thanks for this fieldtype. I would love to use it but when I save or update an entry with a SC Category Select field I get this error on a blank page:

NoticeUndefined indexcat_id in [SERVER_PATH]/system/extensions/fieldtypes/sc_category_select/ft.sc_category_select.php on line 140

Warning
Cannot modify header information headers already sent by (output started at [SERVER_PATH]/system/extensions/fieldtypes/sc_category_select/ft.sc_category_select.php:140in [SERVER_PATH]/system/core/core.functions.php on line 315 

I also get @nbsp@ @nbsp@ in the select options for nested categories (see attached image).

EE 1.6.9
Fieldframe 1.4.2

Any ideas?

Image Attachments
sc-category-select-nbsp.png
Click thumbnail to see full-size image
 Signature 

My ExpressionEngine Bookmarks | Twitter @freshmango

Profile
 
 
Posted: 06 July 2010 02:35 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  465
Joined  06-15-2008

I third the motion for not overriding existing category selections. Is this easy to implement?

 Signature 

RYAN BURNEY • Lead Web Developer, 3 Roads Media
Denver based web and graphic design • EE Pro Network

Profile