How to pass views reference id to a drupal_view() method?

28/07/2018


Currently I’m using Views Reference Field to try and get the ID of the views from my node, pass the value to the drupal_view method and output it to my twig template(page.html.twig) The snippet below is a sample of what I’m currently trying to do.

{% set works_type = node.field_view_works.entity.id %}


{{ drupal_view('{{works_type}}', 'block_1') }}
{{ drupal_view('{{node.field_view_works.entity.id}}', 'block_1') }}

The following code above does not seem to work. Is there any way to get the view ID and pass it to the drupal_view() method?

قالب وردپرس