Home › Forums › Calendar Products › Community Events › Limit tags in Community> Add Event
- This topic has 4 replies, 3 voices, and was last updated 6 years, 10 months ago by Courtney.
-
AuthorPosts
-
August 27, 2015 at 8:09 am #999599MasonParticipant
Hi,
I found this great plugin in your repository which adds the event tags to event submission page: https://theeventscalendar.com/support/forums/topic/adding-tags-to-submit-events-form/
I really want to limit the tags to those that I created and let the users check the boxes for 1 or more tags.
How can I achieve this?
Thank you.
MasonAugust 27, 2015 at 8:45 am #999617GeorgeParticipantHey Mason!
If you mean this plugin here, this is unfortunately an un-official un-supported plugin that is just meant as a starting point for code customization on your site → https://github.com/bordoni/tec-forum-support/tree/plugin-954138
Is that the plugin you mean? If not, share a link directly to the plugin you’re referring to.
I’m sorry that we don’t offer support for custom code, especially for our quick support-snippet plugins like this one which aren’t “official” plugins – however, I’m happy to offer some advice here to at least get you started despite all this.
You should be able to achieve what you want here – a checkbox selection of existing tags, instead of comma-separated ones like this plugin does by default – by rewriting things to just get a list of your existing terms and then have checkbox HTML inputs instead of a comma-separated list via a text input.
To get the list of existing terms, use the get_terms() function, which you can learn about here → https://codex.wordpress.org/Function_Reference/get_terms
Then, simply run a foreach loop and generate a checkbox input for each existing term.
You will have to play around with getting the checkboxes to save and submit correctly, and such, which are things we unfortunately cannot help with. But you should be able to get most of the way there just with the information I’ve shared here, and can hopefully put together something useful on your site.
The “Event Categories” section of the form already works this way, with checkboxes of already-existing category names, so definitely give any category-related code in Community Events a read and steal as much of the concepts and code as you can there for your own addition of the tags! 🙂
Best of luck with your customizations,
GeorgeAugust 27, 2015 at 8:58 am #999625MasonParticipantThanks very much George. Appreciate your input 🙂
August 27, 2015 at 12:29 pm #999678GeorgeParticipantGlad to help @Mason! I’ll close up this thread for now but if other issues/questions/concerns arise, open a new thread any time 🙂
Cheers,
GeorgeJune 7, 2017 at 6:03 am #1294344CourtneyMemberWe’re happy to announce you can now allow users to add Tags to their events when submitting them to your site.
Don’t worry, they won’t be able to go crazy and add 80 million new tags on your site – in the same way categories work, users can only add existing tags that an admin has created to their event. And if you wish to remove Categories and Tags from the event submission form, you can do so with simple customizations.
Learn more about this and more Community Events updates at https://theeventscalendar.com/community-events-4-5-refresh/.
-
AuthorPosts
- The topic ‘Limit tags in Community> Add Event’ is closed to new replies.