Is it possible to override templates?

Hi there Team HP (Andrii)

Is it possible to override a HivePress Bookings templates, and what would be the correct directory structure in the theme to place the new template file?

Hi,

You can override the available templates in HivePress > Templates, please check this doc How to customize templates - HivePress Help Center. You can also override the template parts using a child theme, please check this doc How to override template parts - HivePress Help Center

​I hope this is helpful to you.

Hi there Team HP (Andrii)

I’ve worked through those docs and have previously managed to override the HivePress core plugin template files. The question relates to overriding HivePress extension plugin templates, like the HivePress-Bookings plugin.

Where do we places the custom template files for the extension plugins in the child theme directory structure, for instance the Bookings view page template that is at hivepresss-bookings\includes\templates\class-booking-view-page.php in the plugin?

Hi,

Yes, that’s right, you need to view the template parts in this path hivepresss-bookings\includes\templates.

Hi there Team HP

It seem like we’re misunderstanding each other a bit,
I know where to find/view the templates, what I want to know is where do I place the new templates in the child theme so they override the hivepress/bookings templates?

/wp-content/themes/child_theme/ ???

Hi,

You need to create a similar path in the child theme as in the parent theme. Please see this document in more detail, there is a video tutorial that shows and explains this in more detail How to override template parts - HivePress Help Center

Hi there again Team HP (Andrii)

The documents and YouTube videos you keep directing me to explains how to override templates in the Plugin\ TEMPLATES \ directory, but I’m trying to override a template in the Plugin\ INCLUDES \templates\ directory, which the documents and videos don’t explain.
So I can’t get it working and seeing HivePress has paused the customization service, could you please ask one of the Second Level Support/Developers (Ihor or Yevhen) to explain to me how to do this, as you keep directing me to the same documents and videos which isn’t resolving my question/issue. I can also not find a developer on Fiver or UpWork that knows the HivePress framework sufficiently to get this done for me. I’m using a PHP developer that I found on UpWork, and he can’t even get it right as he keeps asking me about the HivePress framework, and where he should place the class-bookings-view-page.php modified template file in the child theme.

THANKS! :upside_down_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

I’m sorry for the late reply, there was a delay in replies to developer-specific topics.

It’s not possible to override the template files in the includes folder in the same way as it’s possible with the template parts, but you can override the template blocks via the filter hooks. These files in the includes folder define arrays of blocks used in each template so you can override them as described here Templates - Developer Docs For example, to override the booking page blocks you can use the hivepress/v1/templates/booking_view_page hook. I recommend overriding specific template parts via a child theme if these are available outside the includes folder and if you don’t need to change the overall template layout.

Hope this helps.

Thanks for the belated reply Ihor. We kinda figured out ways around that, not exectly your way of using the hook, but its working. Will have to wait until something “break” should there be plugin updates from HivePress side and then re-look our methods used.

1 Like