Shared base templates

Hi there. Is there a good way to share a base- template between different page- templates? (Not including base.php which I’m already using.

I have a subset of pages on my site that uses a specialised template, which I currently have setup as a theme template, goats-know.php and base-goats-know.php. Then I load the page specific HTML from wordpress. However, the code is somewhat more complex than I like to use the WP editor for, I’d way way rather have this code in-repo, where I can use my text editor and version control it. But do to that, I need to then create a page-<page-slug>.php and base-page-<page-slug>.php for each of 20 pages.

Definitely not DRY.

Is there a good way to tell page-<page-slug>.php to render within a common base-goats-know.php base template?

@Foxaii’s plugin covers this -

You can also use the sage/wrap_base filter