This forum is for assistance with theme development.

How to check if a field value is not empty

Hey. How to make the condition "if the field is not empty"? I try so:

if ($form[$field_name]['value']['#default_value'])

. It's not working. Page field user "link to the taxonomy term"

Drupal 8 print image

Hello,

How I can print my logo image on page.html.twig file?

Thanks..

Twig: How to list out taxonomy with multiple values + custom fields

I have this which works for the title only.    How can I get the value of field_nmls?   It's blank for me.

    {% for item in content.field_team_members %}
      {% if item['#title'] %}
        <div class="field-item">{{ item['#title']  }}</div>
        <div class="field-item-2">

          {% if item.hasField('field_nmls') == true %}
           {{ item.field_nmls.value }}
          {% endif %}
        
        </div>
      {% endif %}
    {% endfor %}

Error InvalidArgumentException</em>: Placeholders must have a trailing [] if they are to be expanded with an array of values

I have been submitting an error when sending my Drupal form, the code is designed to insert the values of a select type field in my database. I do not know what I'm failing but I've been trying to find an answer for over a week and I could not.

/*METODO CONSTRUCTOR DEL FORMULARIO -  buildForm*/

Public function buildForm(array $form, FormStateInterface $form_state) {

  $form['WishForm'] = [
    '#type' => 'fieldset',
    '#title' => $this->t('Favorites'),
  ];

Add css by content type gives me theme error

Really new about D8

At the moment i can able to add css to home page only with this code:

corolla.libraries.yml

customization:
  css:
    theme:
      styles/css/corolla.custom-layout.page.css: { weight: 200 }

corolla.theme

Problem using gulp inside Zen sub-theme

Hi all. I'm trying to develop a sub-theme from Zen in Drupal 8, using Gulp as the task runner. Having some problems I hope someone can shed some light on.

I'm running things inside Docker containers using the 8.6.2-apache offical Drupal image, and the latest official MariaDB image.

I've got the sub-theme created, and it is set and working as my default theme. No issues there.

However, when I try to run gulp I get a TON of errors.

Here's the process I'm following.

1. Launch MariaDB container

Pages

Subscribe with RSS Subscribe to RSS - Theme development