Customizing the Saved Venue and Organizer menu areas on the Submission form

Home Forums Calendar Products Community Events Customizing the Saved Venue and Organizer menu areas on the Submission form

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #954347
    Tony
    Participant

    Hi,

    I have just finished customizing the front end submission form, removing HTML tables and adding additional markup (to make the form more responsive and fit in with the other forms in our theme).

    However, it would appear that the saved venue and organizer areas are created via functions in the main plugin class file (displayEventVenueDropdown and displayEventOrganizerDropdown in the-events-calendar-class.php) and they output table rows and cells.

    How do I remove these table cells and rows (and preferably add my own markup)?

    #954417
    Barry
    Member

    Hi Tony,

    That’s a great question.

    A facet of this is that we use some of the same methods in the admin environment and in the frontend – and what works in one is not necessarily a good fit in another, particularly within a customized frontend view.

    To take the specific examples you cited, these are pulled in via action calls, and because (unfortunately) their output is not filterable – at least not in the current release – what you’d really need to do here is unhook them and replace them with your own replacement callbacks, which could largely be based on those existing methods but generate different HTML output.

    It’s admittedly not ideal and is something of a more advanced customization to make, but hopefully that gives you a few ideas you can investigate in more detail.

    #955372
    Tony
    Participant

    I tried to unhook them but got a little lost in the code so have had to simply surround the offending table rows with a table tag and then hack the CSS to render the venue and organizer tables as ‘not-tables’.

    I would prefer to replace the mark-up as this solution feels dirty so if there is any further help (code examples?) available then that would be great.

    #955398
    Barry
    Member

    Hi Tony,

    This code shows the basic process (of course, you’ll need to adjust so it outputs HTML that makes sense in light of your other changes):

    add_action( 'wp_loaded', 'replace_ce_venue_dropdown' );
    
    function replace_ce_venue_dropdown() {
    	if ( is_admin() ) return;
    	$events = TribeEvents::instance();
    	remove_action( 'tribe_venue_table_top', array( $events, 'displayEventVenueDropdown' ) );
    	add_action( 'tribe_venue_table_top', 'ce_custom_venue_dropdown' );
    }
    
    function ce_custom_venue_dropdown() {
    	echo '<select><option>Replacement dropdown</option></select>';
    }

    Does that help?

    #958933
    Barry
    Member

    Hi!

    It’s been a while so I’m going to go ahead and close this topic.

    • Need help with anything else? Go right ahead and post a new topic, one of the team will be only too happy to help
    • Still need help with this issue and need to re-open it? Again, please simply create a new topic and link to this one to provide the team with some context

    Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Customizing the Saved Venue and Organizer menu areas on the Submission form’ is closed to new replies.