• Resolved frankmanl

    (@frankmanl)


    “add new event” adds blocks by default in order:
    date – description – price – organizer – venue – event’s website – calendar exports
    see this image

    I want to change that order e.g. as in this image.

    How can I do that?
    There is some info on TEC’s website (e.g. How to Customize Template Files, but that regards the order of content, comments, footer etc.
    I want to change the default order of the content itself.

    Frank

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter frankmanl

    (@frankmanl)

    Never mind. My intention was to change the order of elements at the front end of the website.
    I found out that’s also possible using css, which of course is a much better solution than changing TEC files.
    It would have to be something like this:

    .type-tribe_events {
    	display: grid;
    }
    /* date and time */
    .tribe-events-schedule {
    	order: 10;
    }
    /* entree fee */
    .tribe-block__event-price {
    	order: 20;
    }
    /* link to artist's website */
    .tribe-block__event-website {
    	order: 30;
    }
    /* this is the 'real' content of the event: promotional text, images */
    .type-tribe_events p,
    .type-tribe_events figure
    {
    	order: 100;
    }
    /* Google calendar & iCal export */
    .tribe-block__events-link {
    	order: 500;
    }
    /* organizer */
    .tribe-block__organizer__details {
    	order: 300;
    }
    /* venue */
    .tribe-block__venue {
    	order: 400;
    }

    @frankmanl

    Thank you so much for sharing your solution!

    As it turns out, we are also working on providing more flexibility for Block Editor while we redesign the Single Event View.

    To set expectations, this is a long-term project (probably mid-2022 if all goes well).

    So hang in there and please reach out again should you have any other issues or suggestions.

    Cheers,
    Geoff

    Thread Starter frankmanl

    (@frankmanl)

    It turns out my css solution is not working out well (‘display: grid’ puts all following blocks underneath each other, even outlined images).
    I’m looking for a way to override the Editor.php file now.

    original location: the-events-calendar\src\Tribe\Editor.php

    Is there a way to add my own Editor.php in my theme folder?
    I tried a view locations, but none of them work …

    [your-theme]/tribe/Editor.php
    [your-theme]/tribe/Tribe/Editor.php
    [your-theme]/tribe/events/Editor.php

    Frank

    Hi there,

    Thanks for getting back to us.

    We’ve released some updates that should allow you more flexibility with the block editor to achieve the results you want. Please install the latest version of our plugin and see if it works for you.

    Best regards,

    Marho

    Thread Starter frankmanl

    (@frankmanl)

    Hello Marho, I don’t see any settings to change the order of blocks permanently.
    Neither an instruction in the source code to override file the-events-calendar\src\Tribe\Editor.php
    Do I miss something?

    Frank

    Hi Frank!

    It’s possible to change the default order of the blocks when creating a new event, with use of a filter.

    add_filter( 'tribe_events_editor_default_template', function( $template ){
    
        // initiate our array
        $template = array();
    
        // default blocks
        $template[] = array( 'tribe/event-datetime' );
        $template[] = array(
            'core/paragraph',
            array(
                'placeholder' => __( 'Add Description...', 'the-events-calendar' ),
            ),
        );
        $template[] = array( 'tribe/event-price' );
        $template[] = array( 'tribe/event-organizer' );
        $template[] = array( 'tribe/event-venue' );
        $template[] = array( 'tribe/event-website' );
        $template[] = array( 'tribe/event-links' );
    
        // return the array of blocks with our custom order. 
        return $template;
        
    }, 500);

    Just rearrange the order of the blocks in the snippet, as you would like them to appear. This snippet would go in your theme’s functions.php file, or in a functionality plugin.

    Hope that helps!

    Best,
    Sky

    Since we haven’t heard from you in a while on this topic we will assume that the problem was fixed or is no longer applicable and with that I will mark this as resolved.

    If that is not the case, please let us know and we will gladly remove the “Resolved” tag and try to help you further. Or you can create a new topic with the problem if you prefer.

    Best,
    Sky

    Thread Starter frankmanl

    (@frankmanl)

    Sorry for not responding before, but I’m very glad with the solution you offered.
    I’m going to use it!
    Frank

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘change “add new event”’ is closed to new replies.