[6.x] Add configurable @blueprint template base path#11632
[6.x] Add configurable @blueprint template base path#11632o1y wants to merge 1 commit intostatamic:6.xfrom
@blueprint template base path#11632Conversation
Adds a new configuration option to customize where Statamic looks for templates when using `@blueprint` in collections.
101df2f to
b2f56c1
Compare
|
What's your actual use case for this? |
|
I want to reuse the same set of templates (mapped to blueprints with the same name) across multiple collections without duplicating template files. This is my views folder: Currently, {{ partial src="shared_blueprints/{{ blueprint }}" }} |
|
Gotcha so you just want to avoid the collection prefix and replace it with your own basically. |
|
This would be such a handy thing to have... we're about to launch one site that has 7 Collections which each have the same requirements so a copy of the same Blueprint. Another currently in dev has 3. For the one with 3, we need separate Collections because page names are the same among Collections (split by Audience), and if we put it all in one, and have an Entries fieldtype, we could see "Get Started" twice (once for each audience) but have no idea who it is for. In separate Collections, the fieldtype shows the Collection it is from. For the one with 7, it is a deeply nested tree with large Collections: just too hard to manage in one big Collection. The ability to have a central Blueprint shared among Collections would be epic. |
@blueprint template base path
Adds a new configuration option to customize where Statamic looks for templates when using
@blueprintin collections to map templates to entry blueprints.If template:
@blueprintis set on the collection, by default it looks for a template that corresponds with the blueprint inresources/views/{collection}/{template}.antlers.html./resources/views/{blueprint_template_base_path}/{template}.antlers.html.