Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[5.x] Add configurable @blueprint template base path #11632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
o1y wants to merge 1 commit into statamic:5.x
base: 5.x
Choose a base branch
Loading
from o1y:custom-blueprint-base-path

Conversation

o1y
Copy link
Contributor

@o1y o1y commented Mar 28, 2025
edited
Loading

Adds a new configuration option to customize where Statamic looks for templates when using @blueprint in collections to map templates to entry blueprints.

If template: @blueprint is set on the collection, by default it looks for a template that corresponds with the blueprint in
resources/views/{collection}/{template}.antlers.html.

  • With the new config option the user can set a different base path /resources/views/{blueprint_template_base_path}/{template}.antlers.html.

Adds a new configuration option to customize where Statamic looks for
templates when using `@blueprint` in collections.
@o1y o1y force-pushed the custom-blueprint-base-path branch from 101df2f to b2f56c1 Compare March 28, 2025 10:21
Copy link
Member

What's your actual use case for this?

Copy link
Contributor Author

o1y commented Apr 25, 2025
edited
Loading

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:


resources/
└── views/
 ├── shared_blueprints/ 
 │ ├── page_builder.antlers.html
 │ ├── simple_page.antlers.html
 │ └── article.antlers.html
 └── ... 

Currently, ⁠template: @blueprint forces templates into collection-specific folders (⁠views/pages/, ⁠views/landing_pages/). This would require duplication. With the proposed config option, you could avoid this template dispatcher partial:

{{ partial src="shared_blueprints/{{ blueprint }}" }}

Copy link
Member

Gotcha so you just want to avoid the collection prefix and replace it with your own basically.

o1y reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /