In case you haven't noticed, the internet isn't going anywhere--or is it? The web is constantly changing and evolving. Is your online presence up to snuff with the times we live in? We can get you there.
I've recently discovered that check box, radio box and drop down lists can be automatically populated in your form from the categories in your blog. This is very helpful!!
Can the options surrounding this feature be built upon? The things i'd like to have are:
option to display parent/child/child/child categories and relationships in a tree structure
option to add or exclude category numbers from the list
Perhaps these can already be done and I just havent figured out home to do them yet….. any help would be great.
Thanks for a great (5star) plugin!
10:25 pm October 4, 2010
Steph
2
This isn't currenly an option, but if you'd like you could override the list of categories from a new plugin or your theme functions.php. Are you familiar with PHP if I point you in the right direction?
9:15 pm October 6, 2010
Gerard
3
I'd like to make these customisations on a form-by-form basis and I dont know of a plugin will do that. Is there one?
Not familiar with PHP, but i've gotten this far without any skills whatsoever, so perhaps point me in the right direction and I'll see what I can do….. (I can always leach off a friend for help if need be)…
Thanks.
7:48 am October 11, 2010
Steph
4
So here's some code that can be add to a new plugin or your theme functions.php and customized as needed:
//the numbers above don't need to be changed. The 20 is the order this filter should be fired. Mine fires at 10, so your must be after that in order to override my categories. The 2/3 is the number of parameters passed.
function set_custom_cats($values, $field){ if($field->id == 25){ //change 25 to the category field ID of your first form $categories = get_categories(array('type' => 'post', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false)); //change this line to get the categories you would like for this field $options = array(); foreach($categories as $cat) //this set the categories up in the format needed for Formidable $options[$cat->term_id] = $cat->name; $values['options'] = $options; }else if($field->id ==40){ //change 40 to the category field ID of your 2nd form $categories = get_categories(array('type' => 'post', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false)); //change this line to get the categories you would like for this field $options = array(); foreach($categories as $cat) $options[$cat->term_id] = $cat->name; $values['options'] = $options; } return $values; }