This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal
Thursday 07 July 2016 5:47:19 pm - 3 replies
Hi all,
I'm currently working in a project using the ezpublish legacy admin and the new stack for final user. I'm having problems using ezflow blocks as I need to get the current landing page node id inside the block twig template. I have tried to print available variables using {{dump(var)}} but I get a white screen as the php allowed memory is exhausted. I also made a {{dump(_context|keys)}} to get the available variables and printed them individually but I also get white screen for some of them. Is there a template function to get the current node id or should I make a new controller to get it?.
Thank you,
Julian Mancera
Friday 08 July 2016 2:33:55 am
Hi
You need to pass it to the controller using params:
{{ render_esi( controller( 'ez_page:viewBlockById', { 'id': ezblock.id, 'cacheSettings': { 'smax-age': 7200 }, 'params': { 'location_id': caller_location.id, } } ) ) }}
Then in the controller you have access to it and then you can do whatever you want and finally pass to the template:
public function topicsPageAction( Block $block, array $params = array(), array $cacheSettings = array() ) { ... use the params, you can add more variables to it $response = $this->get( 'ez_page' )->viewBlock( $block, $params, $cacheSettings );
You must be logged in to post messages in this topic!