-
The docs kinda tease you about adding to an existing theme and then go on to only explain starting with the timber starter. Maybe i'm wrong and/or it's late and my eyes aren't working. Can anyone recommend a nice walk-through on adding timber to an existing theme? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
jarednova
May 28, 2022
Replies: 1 comment
-
@james0r I couldn't find a good tutorial, but here's a quick snippet /* index.php */
/* other stuff going on in your index.php file up here */
$context = Timber::context();
$context['posts'] = new Timber\PostQuery();
$context['foo'] = 'bar';
$templates = array( 'index.twig' );
Timber::render( $templates, $context );
// here is where you'll get output from whatever is in index.twig + $context
/* other stuff going on in your index.php file down here */ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Levdbas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@james0r I couldn't find a good tutorial, but here's a quick snippet