the-events-calendar / events-gutenberg

https://theeventscalendar.com/extensions/events-gutenberg/
Other
32 stars 2 forks source link

Can't override template in theme #476

Closed pinksharpii closed 6 years ago

pinksharpii commented 6 years ago

With this plugin active, my single-events.php does nothing. We need to make some changes to the banner and h1 positioning to match the rest of the theme. With it being coded into the single-event.php in this plugin, we can't do anything. It seems the single-event.php in this plugin is the supreme overriding template, rather than the one in our theme.

bordoni commented 6 years ago

Hi @pinksharpii,

Thanks for reporting this problem to us.

You are talking about the Event Title (h1), but I don't know what you mean by Banner.

The expected behavior is that any of the files included in the views folders can be overwriteable by creating a file on the following path in your theme:

[your-theme]/tribe/gutenberg/[file].php

// E.g.:
[your-theme]/tribe/gutenberg/single-event.php

With your report, I was able to fix some bugs which were preventing that from happening. We will have it fixed on the next Alpha bug release.

My Best Regards,

pinksharpii commented 6 years ago

I see. I just have the file in /tribe-events/single-event.php without the gutenberg subfolder. I didn't see separate documentation for the gutenberg plugin theming.

I did add it to both /tribe/gutenberg/single-event.php and /tribe-events/gutenberg/single-event.php and I don't see my custom template changes. It's still using the template from the gutenberg plugin rather than my theme.

(And by Banner I just mean adding a DOM element to the page before the content)

bordoni commented 6 years ago

@pinksharpii yeah you are right, the /tribe/gutenberg/single-event.php is still not doing what it was intended to do due to a bug in our code which I just patched up on #477, and on version 0.3.5-alpha you should be able to see your template changes.

We might deprecate the tribe-events folder eventually, right now that will be reserved for the old views for now. Anything relates to the Blocks editor will be in the tribe folder in your theme.

You are correct in saying that we don't have a separate documentation for Gutenberg theming yet, but it's in our plans to update that.

Thanks for the great feedback here.

pinksharpii commented 6 years ago

Thank you for your speedy and helpful response :)

Unfortunately our client site is on wordpress.com so we can't update the plugin until a new version is pushed. But I'm glad you were able to figure it out.

Do you have an ETA on the next version release? I will go back to our team with this feedback for the time being.

bordoni commented 6 years ago

We are waiting on one more feature to get wrapped up before we prep the next release, which our expectation is most likely by the end of this week.