This forum is for assistance with theme development.

How to pass a custom filename for a Document media type field to file-link.html.twig

Hi, I have a standard Document media type with a field of filename in addition to the standard fields for the type.  I'm then using the Media Library in a text editor to embed a link onto a page for example.  Right now, it's happily printing out the original filename as a link, but I can't think of a way to pass the new custom filename into the file-link.html.twig so that I can render it instead of the original.

Any suggestions on how I can do this or something equivalent would be greatly appreciated!

Group type view

Hello everyone,

I am new to drupal and I wanted to ask you for help to make a view of group types to place it as the main page of my website, where it shows on the left side a single group list item and on the right side 4 group list items in grid shape .. When making the view as a block it does not show me the option to publish it on the main page as it appears in a normal content .. I accept suggestion for the cover of my website I am using Bootstrap for Drupal Base Distrib as theme. Thanks

Getting URL in Media Fields

Hi! I trying to get URL in Media Fields but I can´t.

I have a content type created with 2 fields, a MEDIA field (for video) and another IMAGE.

I am able to get the image url with: file_url(paragraph.field_local_img.entity.uri.value)

But I want to check if the URL of the MEDIA (Video) is empty and it doesn't works the same way.

How can I get the value of the Media URL?

Thx

How do I find out where a twig variable is coming from?

In Drupal, I need to change the output of a template. I'm curious where I can find out this variable chat or phone is originating from?  Is this field from a content type?

{% if chat or phone%}
<ul class="utilities-list no-bullet clearfix">

Print fields of content of a referenced entity field in paragraph template

I currently have the following scenario:

There is an entity reference field in my paragraph, in which you can select a content of a certain type. I now need to print fields of the content referenced in that field in my paragraph template.

I have not yet managed to get any field printed. 

I have tried the following with field_reference being the entity reference field in the paragraph:

{{ content.field_reference.0.entity.title }}

{{ content.field_reference.entity.title.value }}

and variations of it but nothing rendered anything.

How do I target a specific Node/Page with if statement in twig?

In my page.html.twig template, I am using this if statement:

{% if not is_front %}
to add an iframe.
This works for all internal pages, however I only want it to display on 1 particular page of the site.
What if statement would I use to allow something within the page.html.twig template to only show on a certain page?

Pages

Subscribe with RSS Subscribe to RSS - Theme development