Limit tags in Community> Add Event

Home Forums Calendar Products Community Events Limit tags in Community> Add Event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #999599
    Mason
    Participant

    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.
    Mason

    #999617
    George
    Participant

    Hey 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,
    George

    #999625
    Mason
    Participant

    Thanks very much George. Appreciate your input 🙂

    #999678
    George
    Participant

    Glad 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,
    George

    #1294344
    Courtney
    Member

    We’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/.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Limit tags in Community> Add Event’ is closed to new replies.