Is it possible to override default plugin template with Bricks?

Hello,

I’m a newbie and would like to know if it’s possible to overrride a plugin template ?

I’m using the eventin plugin to handle my events, and this is the procedure to manually override their template:

Pretty basic and common, just copy their single-event.php to the bricks-child folder template.

But when I do that, I would like to be able to modify the template inside Bricks and not manually with a text editor.

The eventin plugin create the Custom Post Type “Events” so I’ve already tried to create a Bricks “Single” template of type “Post” “Events”

2023-01-31 20_42_03-Event (Template)

But I can’t make bricks to use it to show my events :frowning:

So the real question is, is there some magic code to put inside that single-event.php file so Bricks would be used to modify/create the Single event template of eventin ?

Eventin even create a lot (31) of custom fields that are recognised by Bricks as dynamic data which would be easy to integrate to that template:

2023-01-31 20_45_32-Event (Template)

I’ve asked the eventin developpers if they’re going to support Bricks at some time, they replied yes but with no date.

They already support Oxygen for single event template, so I guess it should not be hard to have something working with Bricks :slight_smile:

Thanks and Regards,

Nicolas.

1 Like

This is what ive looking for but it seems no one in the bricks community nor the developers saw this post.

It would be great to make it work. I am facing the same issue.

Since my initial post, I have tested the solution presented in the following two brickslabs article:

It was working but I didn’t make any further investigation as my client was finally happy with the default template from eventin.

1 Like

Thanks for the help, but these are Pro (restricted) content. Also, I have an Eventin License, so I would like to solve the problem with it. But Thank You for your help. I’ve sent to Bricks and ThemeWinter a ticket about the problem, hope it will be fixed soon.

For those interested, I found a way to bypass the Eventin templates using template redirects. While the solution requires code snippets, it’s much easier than copying, pasting, and editing folders and files on the server:

Redirect the Eventin archive template to the Bricks archive template

<?php 
add_action('template_redirect', 'disable_eventin_archive_template', 1);

function disable_eventin_archive_template() {
    // Check if we're on the Eventin 'etn' post type archive
    if (is_post_type_archive('etn')) {
        // Get the path to the default archive template (Bricks)
        $bricks_template = get_theme_file_path('archive.php');
        
        // Override Eventin's template
        include($bricks_template);
        exit; // Stop further execution
    }
}

Redirect the Eventin single post template to the Bricks single post template

<?php  
add_action('template_redirect', 'redirect_single_event_to_bricks_template', 1);

function redirect_single_event_to_bricks_template() {
    // Check if we're on a single Eventin post
    if (is_singular('etn')) {
        // Get the path to the default single template (Bricks)
        $bricks_template = get_theme_file_path('single.php');
        
        // Include the Bricks template
        include($bricks_template);
        exit; // Stop further execution
    }
}

There are other template types as well. I haven’t gotten though them all yet.