I'm currently using the starter module which adds the Twig function place_view()
. This works well in most cases, however I'd like to be able to pass another parameter to populate the fixed value given in a contextual filter.
This would be my contextual filter settings:
Here's the place_view()
Twig function:
public function place_view($name, $display_id = 'default') {
$drupal = \Drupal::service('renderer');
$view = views_embed_view($name, $display_id);
if(! is_null($view)) {
return $drupal->render($view);
}
return null;
}
Preferably I'd like to be able to use place_view()
with a parameter to adjust that fixed value. It'd be even better if I could somehow reference the contextual filter I wanted to adjust the fixed value of.
Hopefully that all made sense, thanks in advance.