Only Display a User's Organizers and Venues (Redux)

Home Forums Calendar Products Community Events Only Display a User's Organizers and Venues (Redux)

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1054691
    Mad Dog
    Participant

    About six months ago I asked about this and even added votes to a “Suggest a Feature.” I’m hoping something has changed or someone has a way to do this:

    It’s confusing to Users to see all venues and organizers in their dropdown when creating a new Event. Even though theirs are listed first, some people get confused….not to mention they don’t need to see anyone else’s Organizers or Events. Is there any way to limit this so users only see their own Organizers and Venues? It seems odd to me that it would be any other way anyway!

    THANKS
    Mad Dog

    #1054889
    Hunter
    Moderator

    Hey Mad Dog,

    Welcome back 🙂

    I completely understand where you’re coming from. Unfortunately, not much has changed in the dropdown capabilities on the Submit an event page. Admittedly, the Venue dropdown is not as in-depth as it probably could be because it isn’t able to be filtered with a function. This means it comes down to building a replacement dropdown which would be a fairly advanced level of customization.

    I apologize I can’t give you an easier solution to going about accomplishing what you describe! Thanks for understanding and if you have any more questions or concerns, feel free to open a new thread.

    #1055586
    Mad Dog
    Participant

    Can you tell me what file creates this dropdown? I know it’s not good form to change a core file that I can’t put in a new theme directory (updates and all that) but if I could just attach a class to “My Venues” and another class to “Available Venues” I could use display:none for the second class or at least change the appearance so My Venues stands out.

    MD

    #1056682
    Hunter
    Moderator

    MD,

    I’d be happy to point you in the right direction. Check out plugins/the-events-calendar-community-events/src/views/community/modules/venue.php. It looks like you’ll need to explore the Technical Docs, more specifically tribe_community_events_venue_select_menu.

    Good luck with it and thanks again for adding it to the UserVoice! Have a great weekend, Mad Dog 🙂

    #1056761
    Mad Dog
    Participant

    Thanks for the head start. Do you know in which file(s) the Organizer and Venue selects are actually “constructed”?

    THANKS

    #1059505
    Mad Dog
    Participant

    Hi…still hoping you can point me to the file that actually “builds” the drop-down selector.

    Thanks!

    #1062042
    Hunter
    Moderator

    Hey Mad Dog,

    Apologies for the delay on getting back to you. The relevant code you’ll need to look into is located in plugins/the-events-calendar/src/admin-views/events-meta-box.php.

    Good luck in achieving the desired functionality and thanks for choosing PRO! Have a great week 🙂

    #1062778
    Mad Dog
    Participant

    I’m not seeing any code in that file that will form an Organization or Venue dropdown menu. I’m looking for where that dropdown is actually created hoping I can assign a class to the options that aren’t owned by the logged in user.

    Am I missing that somewhere in the file?

    THANKS

    #1063441
    Hunter
    Moderator

    Welcome back,

    It looks like you’ll need to explore the-events-calendar/src/admin-views/venue-meta-box.php.

    I wish I could provide more support, however, these types of customizations extend beyond the scope I’m able to provide through the forums. Keep your eyes peeled to the new release changelogs; hopefully it’ll be added into an upcoming version.

    Good luck with everything and thanks again for choosing PRO 🙂

    #1063907
    Mad Dog
    Participant

    I finally found it. It’s in the-events-calendar\src\Tribe\Main.php. I commented out this section for venues and the similar section for organizers.

    if ( $venues ) {
    	//echo $my_venues ? '<optgroup label="' . esc_attr( apply_filters( 'tribe_events_saved_venues_dropdown_optgroup', sprintf( esc_html__( 'Available %s', 'the-events-calendar' ), $this->plural_venue_label ) ) ) . '">' : '';
    	//foreach ( $venues as $venue ) {
    	//$venue_title = wp_kses( get_the_title( $venue->ID ), array() );
    	//echo '<option data-address="' . esc_attr( $this->fullAddressString( $venue->ID ) ) . '" value="' . esc_attr( $venue->ID ) . '"';
    	//selected( ( $current == $venue->ID ) );
    	//echo '>' . $venue_title . '</option>';
    	//}
    	//echo $my_venues ? '</optgroup>' : '';
    	}
    echo '</select>';

    I know this is bad form to do this by hacking a core file, and it will likely be overwritten with an update, but for now it works and the client is happy that Community Users won’t see everyone else’s Venues and Organizers which seems to be the way this *should* work by default.

    If you see anything odd or know of any reason I shouldn’t be doing this, please let me know.

    Thanks!
    Mad Dog

    #1064756
    Hunter
    Moderator

    Hello Mad Dog,

    Thanks for sharing the solution. Don’t forget to back the customized files up before updating. I’ll close this thread out for now, but go ahead and open a new one should you have any more questions.

    Have a good weekend 🙂

    #1079324
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Only Display a User's Organizers and Venues (Redux)’ is closed to new replies.