• Resolved Travis Pflanz

    (@tpflanz)


    I’m trying to override the GatherPress created template for a Single Event page.

    I’m using the MotoPress FSE Theme – https://motopress.com/products/prime-fse/

    I’ve created a “Single Item: Event” template

    When I create a new Event in GatherPress, it still shows the plugin’s default page theme in the editor, however the correct “Single Item: Events” Template is selected in the right sidebar.

    When I enter the event details, add a featured image, and save – my custom “Single Item: Event” template is shown on the front-end.

    However, the editor doesn’t show my “heading” or “event details” sections on the live page – because they’re not available in the editor.

    How can I make GatherPress show my custom “Single Item: Events” Template in the editor when I create a new Event?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author GatherPress

    (@gatherpress)

    Thanks for checking out GatherPress, Travis!

    I was able to reproduce your issue in the Twenty Twenty-Four FSE theme as well, so we’ll look into the issue and get a fix out. Thank you for reporting the issue. ??

    Plugin Author GatherPress

    (@gatherpress)

    Hi Travis, I was able to reproduce, but the issue I saw was a relic from an older version of GatherPress before we made some changes to the post type naming. Just to help us debug for you, can you provide the query string in the URL when you are editing the Single Item: Event template. For example, mine looks like this with the Twenty Twenty-Four theme: wp-admin/site-editor.php?postId=twentytwentyfour%2F%2Fsingle-gatherpress_event&postType=wp_template&canvas=edit.

    The issue I originally ran into was that the old post type for events was gp_event, but we changed it to gatherpress_event. I’m not sure how far back you started using GatherPress, so just want to ensure it’s not the same issue I just saw. After I deleted that template and created a new one, I was seeing the correct template applied to Event post type.

    • This reply was modified 3 months, 3 weeks ago by GatherPress.
    Thread Starter Travis Pflanz

    (@tpflanz)

    /wp-admin/site-editor.php?postId=prime-fse%2F%2Fsingle-gatherpress_event&postType=wp_template&canvas=edit

    I first saw GatherPress early July in the WordPress Repo. Version 0.29.3. I started playing around with it a little ~mid-July, so not very long.

    Per your suggestion, I deleted my custom “Single Item: Events” Template then recreated it. Still the same. When I create a new Event in GatherPress, it still shows the plugin’s default page theme in the editor.

    Plugin Author GatherPress

    (@gatherpress)

    Hi Travis,

    I installed your theme and set my GatherPress version to match yours. I put this Loom together showing that I’m creating a Single Item: Event template, save it, then load the single event and see the change I made. It worked as I would expect, but let me know if you are doing something different that I am not considering. If you’re able to create a video showing steps that could help as well. Thanks!

    Thread Starter Travis Pflanz

    (@tpflanz)

    I should have mentioned in my original post – I tested with no other plugins active other than GatherPress.

    I since have tested with a fresh WordPress 6.6.1 installation with Prime FSE theme and GatherPress – I can confirm this works as expected from a fresh installation as in your previous message.

    The site I’m working on is an established 7ish year old website (working with a staging copy, but tested on the live site since also) that is fully up to date and has been in daily usage – not a dead and outdated site. My plan is to remodel the site using Prime FSE theme and GatherPress – to get away from Meetup completely.

    I think I may have discovered how the issue has occurred, but I don’t know why – This site was previously using the Divi Theme (https://www.elegantthemes.com/gallery/divi/) and there seems to be something in the change from Divi to a full site editor theme that is causing this problem. In addition to Prime FSE, I have tested using the default WordPress Twenty Twenty-Four theme and experienced the same issue with both FSE themes.

    I have now tested on 4 total different Divi websites by changing the theme to FSE themes and in every instance I experience the same error – my custom “Single Item: Events” Template does not override the default GatherPress template within the New Event editor screen.

    Thread Starter Travis Pflanz

    (@tpflanz)

    Re: The video

    To make sure were completely on the same page – I am specifically referring to the Editor screen when creating a new Event, not the live webpage after the Event has been published.

    Here’s a screen capture

    Plugin Author GatherPress

    (@gatherpress)

    Got it, thanks Travis!

    So this may be more a Divi issue then? I’m curious, do you have the same issue with FSE templates with other custom post types from different plugins? I haven’t used Divi, so I’m not sure why it might be doing this. It might be worth putting in a ticket for Divi explaining your issue if you see a pattern with the sites having used Divi in the past. Let me know what you find out. Take care!

    Plugin Author GatherPress

    (@gatherpress)

    Hi Travis,

    Just saw your post with the video. It looks like you aren’t including a pattern for Single Item: Event template. If you select a pattern that should help you with starting things off because there is an important Content block that will display the content from the single event you will need for displaying that content. Then after applying the pattern to the template you can edit around the Content block to add things you’d like to be specifically on that template.

    Keep in mind we are still making major updates to the plugin (we are still in an alpha at version 0.29.3), so FSE with the plugin will be a much better experience as we progress. It’s also good to have this plugin that we make available on GitHub. This plugin fixes any breaking changes we make as we continue to develop the plugin and release new versions. This GatherPress Alpha plugin will continue to be used until we hit 1.0.0. Thanks and let us know if you have any more questions.

    Thread Starter Travis Pflanz

    (@tpflanz)

    With more testing, I think it’s definitely an issue within GatherPress. As you mentioned, you were able to replicate the issue while using the Twenty Twenty-Four theme.

    I’ve now tested with 10 fresh WordPress installations using Twenty Twenty-Four with only the GatherPress plugin active. Not once has my custom “Single Item: Events” Template?successfully overridden the default GatherPress template within the Add New Event Editor.

    I’ve tested by adding my custom event layout in a Pattern and then adding the Pattern to the custom “Single Item: Events” Template.

    I’ve also tested by adding my custom event layout directly to the custom “Single Item: Events” Template.

    No matter how I try to create a custom “Single Item: Events” Template within WordPress, it doesn’t override the default GatherPress layout in the Editor.

    The only way I’ve been able to override the default GatherPress template within the editor has been to create my own template override plugin. NOTE – I’m not a very skilled dev, so this is really the limit of my abilities

    <?php
    /*
    * Plugin Name: My Block Templates
    * Description: Post Types: GatherPress Event
    */

    function gatherpress_event_my_block_template() {
    $post_type_object = get_post_type_object( 'gatherpress_event' );
    $post_type_object->template = array(
    array(
    'core/group',
    array(
    'layout' => array(
    'type' => 'constrained'
    )
    ),
    array(
    array(
    'core/columns',
    array(),
    array(
    array(
    'core/column',
    array(
    'width' => '66.66%'
    ),
    array(
    array(
    'core/columns',
    array(),
    array(
    array(
    'core/column',
    array(
    'width' => '66.66%'
    ),
    array(
    array(
    'gatherpress/event-date',
    array(),
    array()
    ),

    )
    ),
    array(
    'core/column',
    array(
    'width' => '33.33%'
    ),
    array(
    array(
    'gatherpress/add-to-calendar',
    array(),
    array()
    ),

    )
    ),

    )
    ),
    array(
    'core/post-featured-image',
    array(),
    array()
    ),

    )
    ),
    array(
    'core/column',
    array(
    'width' => '33.33%'
    ),
    array(
    array(
    'gatherpress/rsvp',
    array(),
    array()
    ),
    array(
    'gatherpress/venue',
    array(),
    array()
    ),

    )
    ),

    )
    ),
    array(
    'gatherpress/rsvp',
    array(),
    array()
    ),
    array(
    'core/heading',
    array(),
    array()
    ),
    array(
    'core/paragraph',
    array(
    'placeholder' => 'All about the get-together'
    ),
    array()
    ),
    array(
    'gatherpress/rsvp-response',
    array(),
    array()
    ),

    )
    ),

    );
    }
    add_action( 'init', 'gatherpress_event_my_block_template' );

    ?>

    I do understand the plugin is in Alpha, and I’m happy to work it hard with every real-world use-case to find bugs and offer improvement ideas. My ultimate application will be to create a simple front-end form for my Club’s organizers (setup as a custom role) to create a new event for our club.

    NOTE – I’ve added the GatherPress Alpha plugin you linked

    Plugin Author GatherPress

    (@gatherpress)

    Thank you, Travis. I think I wasn’t fully understanding the issue. This is about the template pre-populating blocks for the single event when you create a new event, is that correct? That area of the plugin is something we need to revisit. It was introduced a while back before FSE was even a thing (believe it or not, we started work on the plugin 4+ years ago). We wanted to make it easy for someone to create an event by pre-populating the blocks they’d probably need.

    We haven’t fully landed on how we are going to change this. Right now you have 2 options.

    • You can delete the blocks when you create a new event. Tedious but it’s the lo-tech solution until we release something addressing this.
    • If you are comfortable with adding pre-written PHP code to your site. This bit of code will remove the block template from the single event post type:
    <?php
    add_filter( 'register_post_type_args', function( $args, $post_type ) {
    if ( 'gatherpress_event' === $post_type ) {
    $args['template'] = [];
    }

    return $args;
    }, 10, 2);
    ?>

    A plugin like Code Snippets will allow you to add this code to your site within the admin making it easier. Definitely test this on a test site before adding to production.

    Hope this answers your question and thank you for being patient with us as we continue to progress with the plugin. Thanks! ??

    Thread Starter Travis Pflanz

    (@tpflanz)

    CORRECT – This is about the template pre-populating blocks for the single event when you create a new event.

    Is this possibly a WordPress issue/deficiency, rather than GatherPress? My thought process here is that if WordPress has built-in custom templates for posts/post-types now, then the system as a whole should build-in the ability to override a template that is created by a plugin or theme.

    I’m so excited to have come across GatherPress. We’ve been looking for a simple and straight-forward way to migrate from Meetup to managing our club events and membership to our WordPress website.

    Plugin Author GatherPress

    (@gatherpress)

    Hi Travis, so GatherPress is being explicit about those blocks at the moment, but this is a topic that is being discussed both on the GatherPress team and Gutenberg to make this easier for non-devs. Here are a few tickets to check out on the topic.

    https://github.com/GatherPress/gatherpress/issues/528

    https://github.com/GatherPress/gatherpress/issues/626

    https://github.com/WordPress/gutenberg/issues/53396

    For now, I would follow one of the steps I listed in my previous comment until we land on a good solution here. We’re very happy you are excited about GstherPress. Thank you again for your feedback, it really helps us prioritize and shape the plugin to the needs of the WordPress community. Have a great weekend!

    Plugin Author GatherPress

    (@gatherpress)

    Hi Travis, I’m going to mark this issue resolved as it is known, is on our roadmap, and a temporary fix was provided. Thanks and let us know if you have any other issues for us to look into!

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.