-
Hello, I try to use Timber inside a DIVI extension. Everything is working expect I have to render.
When I do that, I have one render outside divi extension, and one inside. Is it possible to have only one render inside the divi extension ? Thks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@robibi78 Try using public function render( $unprocessed_props, $content, $render_slug ) {
$context = Timber::get_context();
$context['publications'] = $this->get_hal( 'FRANCE-GRILLES' )->docs;
return Timber::compile( 'page.twig', $context );
} |
Beta Was this translation helpful? Give feedback.
-
It was so easy, thks for the answer :) |
Beta Was this translation helpful? Give feedback.
@robibi78 Try using
Timber::compile()
instead ofTimber::render()
. TheTimber::render()
method echoes the output. Because you use a return, I assume you don’t want your output to be echoed in your render function, but only returned as a string: