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!
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
I am getting errors when i try to use :url_title :heading and :description in my templates
MySQL ERROR:
Error Number: 1064
Description: You have an error in your SQL syntax; check 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 1ExpressionEngine 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;
}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!
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/
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
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:
Notice: Undefined index: cat_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:140) in [SERVER_PATH]/system/core/core.functions.php on line 315I also get @nbsp@ @nbsp@ in the select options for nested categories (see attached image).
EE 1.6.9 Fieldframe 1.4.2
Any ideas?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.