This forum is for assistance with theme development.

D8 - Preprocess field

hi everyone,

how can i preprocess a field to get his raw value before twig debug include the debug comment in the content ?
For example i have a list field with letters (A B C D E F or G), for each letter i use a different classe to style differently so in my twig template i naturally tried this :

<span class="note note_energ{{ fields.field_classe_energetique.content }}">{{ fields.field_classe_energetique.content }}</span>

But it also output the twig debug and i get this :

[SOLVED] Echo entity reference url if !=Null

I have create a content type "machines" and I am looking to theme it. At the bottom of each "machine" I would like to create 2 buttons, preview and next. These 2 fields are entity reference of other nodes of the same content type machine.

So I have to create a loop to verify if the field is not empty.

How to collapse blocks or views content.

Hello.

I'm using Drupal 8 and I want one page of the site to have collapsible content sections.
I want to keep the content separate from the functionality.

What I would like to do is:

1. make the content pages (nodes), say story 1, story 2 and story 3
2. I want to have a page called "stories" where the first thing the viewer sees is story 1 expanded, story 2 and story 3 are collapsed except a title.
2. selecting story 2 would expand it.

My questions:

What is the recommended way to approach this?

[SOLVED] How to theme Indexed node fields of a views (Search API)?

Hi everybody,

I am building a faceted search using following modules : search api, facet api. Everything is fine. Then I've create a view to display all the products indexed in the DB. No problem. Now I want to display it as I want using a TPL file. I did it like this but the node title and the node image don't appear. I assume I am doing it wrong in PHP. Can you help me please?

PS: I am using this code for normal view and it works perfectly.

Here is the code

theming node problem

Hello,

How can i render the content from the body field?
I've created a custom tpl file for a specific content type.
If i do the following for showing al my content from that node => print render($content); I get nothing.
https://api.drupal.org/api/drupal/modules!node!node.tpl.php/7.x

hope you guys can help me.

Grtz,
Greg

Pages

Subscribe with RSS Subscribe to RSS - Theme development