Access 'content' or 'node' variables inside View context

118 Views Asked by At

I have a view where there was a file type field. So I added it to the view and rewrote the result for it:

used fields

<a href="{{ field_documento }}">{{ title }}</a>

The above line results in an a tag with the href for the PDF document and the node title as text for the tag.

Now I have replaced the field field_download with the field field_mdownload which is a reference to an entity of type Media document. I can't get the same result with this type of field.

I tried using Twig Twaek and Bamboo Twig for this purpose, and tried direct access to node and content too, but it doesn't seem to work in the context of the view.

I tried to use things like:

node.fileld_mdocument.entity.media_file_document.uri.value

node.field_mdocument | file_uri

field_mdocument | file_uri

file_url (field_mdocument)

<% set node = bamboo_load_entity ('node', nid)%> but here twig doesn't seem to be able to convert the nid to the entire value that represents the node. If I put <% set node = bamboo_load_entity ('node', 1)%> it works.

Does anyone have any idea how I can solve this?

0

There are 0 best solutions below