[Resolved] Question about custom taxonomies – radio buttons instead of checkboxes?
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Is it possible to create a taxonomy that will use radio buttons instead of checkboxes on the edit [custom content type] page? We have set up a taxonomy with Yes or No options to act as a query filter to limit display of Rides in a view to those rides where the Yes option is selected with the taxonomy. But on the edit screen, the possibility is there to choose both Yes and No on this taxonomy because they are checkboxes. It would be better if the person editing the page could only choose Yes or No but not both.
Please let me know if this is possible. It's not terrible if it can't be done because we can just provide instructions to anyone that will be editing rides to make sure to check only one of these options. I was just hoping to avoid any possibility for confusion on this.
I tried the plugin you suggested and I'm seeing one problem that will cause confusion. We named the taxonomy "Add To Ride Maps Page". My two options on the taxonomy are Yes and No. We assigned the Taxonomy to the Ride content type. But on the Add New Ride page, this plugin did change the options to radio buttons as expected, but instead of showing only the defined options, it has added a third option called "No Add To Ride Maps Page"
So we have three options showing as:
Yes
No
No Add To Ride Maps Page
I did find instructions in the plugin FAQ for eliminating this unwanted extra option, but those instructions didn't work. I've now filed another support ticket with that plugin author. I think she'll be able to figure out if I'm doing something wrong.
But if I can't get rid of it, I think this added field is going to cause confusion. It won't be problematic for functionality, but it just seems weird. I think the problem here is that there is this third option of not selecting either option and it is calling no selection by this name. It is defaulting to this No Add To Ride Maps Page option being selected. I was thinking I might be able to make this third option go away if I make the taxonomy selection required, but I'm not sure where to do that. Is there a way to do that?
I also looked to see if there was a way to make the default selection the "No" option. I'm not seeing any way to do that either. The only setting this plugin provides is to define which taxonomy or taxonomies get converted to radio buttons. I'm asking these questions regarding the Toolset side of the equation where the taxonomy is set up.
The thing is that the plugin I shared is just for reference. We can not decide what feature other plugins are offered. You may also try to search for other plugin and check and test if that serves what you required as Toolset simply do not offer such feature to convert taxonomy terms checkboxes to radio buttons.
Understood fully there. I could always just delete MY "No" option and use the extra option their plugin added as the "No" field. I just can't change the name of the field away from "No Add To Ride Maps Page" I think they'll get me the help needed though. I think the author of this plugin is the same as another plugin I've used before where their support was very good. I just have to wait for further replies. She had me try something else and that didn't work either. I let her know that the taxonomy was created through Toolset. I don't know if that makes a difference, but none of her supplied code to eliminate this unwanted additional option the plugin is generating has worked so far.
Is there any way to set a default option with your custom taxonomies? Is there any way to make a selection on the taxonomy required? Feel free to split this reply into another ticket if need be.
Another thought. I could just make this a regular field added to the field group for this content type. I know with that I'd be able to set it to be a radio button, set it to be required and set a default option.
The only reason I set it up as a taxonomy is because I previously had a difficult time getting a query filter or conditional output to work right with a regular field with something I was doing before and it was suggested to make it a taxonomy instead. That worked very well and very easily, so I'm in the habit of making things like this into a taxonomy now.
In addition to the unwanted option being added by this plugin, I now also see that it doesn't save properly with this plugin enabled when I try to set up the Query Filter. When I disable this plugin and use checkboxes, the Query Filter saves properly. The plugin author has indicated there must be a conflict of some kind there that she wouldn't be able to solve. So I think this plugin is ruled out on that basis. I've told her I'd bring it up to you and asked if she'd be willing to assist if you are willing to look at it. I'm not sure if you'd want to do so.
Right now, I'm going to try the plugin I found and see what it does. If that fails, then I'll go ahead with making this a regular field instead of a taxonomy and see if I can get a query filter set up to work based on a Yes option selection on that field. More in my next response.