


Altering Views Exposed Form Elements and their Associated Labels
I have a series of Views Exposed Forms across a Drupal 8 website. My goal is to generate unique template suggestions so I can theme each individual input and their labels differently as needed. Here is my current approach. Placed into theme.theme. I’ve hit a... read more
How to use language-specific menu items in URL aliases
I’m working on a site with internationalization from the source language, English, into a few other languages. Translating the pages has worked out fine; however, I’m running into trouble with URL aliases. Some of our pages have different menu labels vs.... read more
Where can I find the form API reference?
Form API Reference gives information about which properties to use for a form array, for Drupal 7. Where can I see what properties I can use in buildForm(array $form, FormStateInterface $form_state), such as #type, #title, #required, and other possible properties?... read more
How to Unit Test Entity Reference Field Value
I have been tasked with writing a Unit Test for a method where I pass in a Node object, modify an Entity Reference field value, and then return a Node object. Since this is a Unit test, I am unsure as to how to write an assertion. Note: just included relevant code.... read more
How capture video thumbnail , when video is uploaded under media video type file?
I’m using Core media module to upload video[Media Type is video,which has field video of ‘file field type’]. This module will refer video.png as thumnail for all video uploaded from the local system. I want to capture first frame of video as... read more
AJAX doesn’t work in custom form element
I want to create a custom form element for email that have a textfield and button and when click button send an email but ajax not working inside form elemen class. I test it in form api and it’s ok but when move in form element on button click nothing happend... read more
Call to a member function label() on null after saving a node with a taxonomy term
I create nodes, which have a taxonomy field, like this: $node = Node::create([ ‘type’ => ‘article’, ‘status’ => 1, ‘title’ => ‘Some title’, … ‘field_taxonomy’ => [1, 2, 3], ]);... read more