-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Reorder twig files #162
Reorder twig files #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice update! 👍
And yes, I agree with you that archive.twig in combination with {{ parent() }}
maybe is a bit complicated for a starter theme.
We could also just copy over the relevant contents from index.twig to make it easier to start working with archive.twig.
@gchtr , modified the archive.twig and did some other minor tweaks, see comments. |
page.php
Outdated
@@ -17,4 +17,4 @@ | |||
$context = Timber::context(); | |||
$post = $context['post']; | |||
|
|||
Timber::render(array('page-' . $post->post_name . '.twig', 'page.twig'), $context); | |||
Timber::render(array('templates/page-' . $timber_post->post_name . '.twig', 'templates/page.twig'), $context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$timber_post
is not defined here, right?
Co-authored-by: Lukas Gaechter <lukas.gaechter@mind.ch>
This is the first changes in a larger set of changes that I am going to propose.
Related:
Issue
Since the creation of the starter theme a lot has happened in PHP, WordPress and Timber. I want to make the starter-theme a more modern starting point for custom theme development.
Solution
This particular PR focusses on moving twig files to subdirectories for make a separation between the type of twig files.
Impact
A better, less confusing, start with templating in Timber.
Usage Changes
none
Considerations
-archive.twig is still a bit overkill, maybe we can simplify that as well by removing the parent() function