Skip to content
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

Fallback directory for patterns and templates #4

Open
landwire opened this issue May 12, 2020 · 0 comments
Open

Fallback directory for patterns and templates #4

landwire opened this issue May 12, 2020 · 0 comments

Comments

@landwire
Copy link

Hi there,
I was wondering if it is possible create something analog to the following timber fallback functionality with primer.

Timber will look first in the child theme and then falls back to the parent theme (same as WordPress logic). The official load order is:
User-defined locations
Directory of calling PHP script (but not theme)
Child theme
Parent theme
Directory of calling PHP script (including the theme)

I basically want to do the same with primer. So I have the resources directory and lets say resourcesChild directory. If a template xyz.twig is not existing in resourcesChild it will look in resources for xyz.twig and render that one. Obviously includes must work across the 2 directories too.
Is that possible to set up with primer?

Another question: Is it possible to use other names for the twig file than template.twig? I would like to use unique names for all patterns, basically following the following structure:

component-a
    component-a.twig
    component-a.scss
    component-a.js
    data.php -> I would prefer component-a.php, .yaml, .json

component-b
    component-b.twig
    component-b.scss
    component-b.js
    data.php -> I would prefer component-b.php, .yaml, .json

Thanks for any answers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant