This forum is for assistance with theme development.

[Solved] Views : get value of another field in views-view-field--field_name.html.twig

Hello

I have a content with two fields :

  • image
  • background image

I have a view which displays the image and get the background color (hidden field).

I want to edit the twig template of the image field to add the background in css inline like below :

views-view-field--field_image.html.twig

<div id="color" style="background-color:#{{ view.field.field_background.original_value }}">
{{ output -}}
</div>

I can't succeed to get the background field.

Entity Reference Field show only un-used values/items in dropdown?

Hi,

I have two content types (PPL Fields & Production), I have created a Entity Reference Field(using Entity Reference View to get filtered list of PPL Fields) in Production.

Content printing in twig (9.0.7)

Hello all, I'm developing a node--testcontent.html.twig

I want to show the content of the body with its format.

I understood that I need to use

{{ content.body }} but this does not print anything.

If I code {{ content }} I get everything nicely formatted. If I tried to list all in with a for cycle and I get only the key "_field_layout".

Admin Menustrip Blocks Theme Header

I'm experiencing some weirdness when viewing pages from admin. The admin menustrip, which can be viewed either horizontally or vertical blocks display of my theme's header. The theme display fine when logged out. Is there an option to prevent the menustrip  blocking the top portion of my themes?

changing <a> color using Settings --> Advanced Options --> Inline CSS

We have a custom theme that is being used by over 100 sub-sites for one University.  ONE of the sub-sites would love to have me change the color of their linked content from red to blue.  I can't change this in the actual theme for them because it will affect all the sites. I tried adding a simple a {color:blue;} to the inline CSS box in Advanced Options but apparently its not as simple as that.  They have linked text in <p>, <h2>, <h3>, <h4>, <h5> and <h6>.  I would love some advice on what step to take to get this change to happen.

View keeps changing theme

I have a view

It used to be called 'page_1'
It is now called 'c_page'

I have created a template called 

'node--view--branch-list--c-page.html' to render this view

This worked perfectly for many weeks. Until now

Sometimes when i load a page created by this view it is very very glitched.
And sometimes when i load a page created by this view it is fine.

After much investigating i discovered that this is happening because the template suggestions are different on each page load

sometimes the first two template suggestions are

Pages

Subscribe with RSS Subscribe to RSS - Theme development