This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to add options dynamics in a Select Field

Hi, 

I added to a extra field in the CMS (Structure > Block > Tier > Managefield) Field Type is List(text) and Widget is Select List. 

Name: Value sustainability Machine Name: field_tier_value_sustainability

After, I edited another field (Type) adding one more option (sustainability) in the field Allowed Values List (The new field only show when select the option sustainability in the field Type).

Help using Ajax in formbuilder

I am making a form using formbuilder, and it has some ajax on it. I am having trouble trying to get values on the submit handler of the ajax field. 

I have a parent container called ['isbn'],

  $form['isbn'] = [
'#type' => 'container',
'#id' => 'isbn_search',
  ];

and inside of that are two children:

['isbn']['number'] - which is a textfield

Altering a node link title in Viewbuilder; #pre_render

My custom block gets multiple nodes and uses ViewBuilder to render these nodes. The node titles in this block are linked to the canonical route. That works for a default but my customer wants to link to an external link if that attribute has that value. So I'm incorporating TrustedCallbackInterface in my custom block to build a pre_render callback. But I'm getting an unexpected error:

Parameter 1 to Drupal\mymodule\Plugin\Block\MyBlock::changeUrl() expected to be a reference

Here's an excerpt of my custom block

access to field name in fields loop

first of all i tried to print field content as {{ kint(field) }} but it causes blank page, also {{ kint(field.content) }} renders markup output, i need to check the field name as below

{% for field in fields -%}

{% if field.name == 'field_image' %}

... do something

{% endif %}

{%- endfor %}

Login to drupal 8 from a php script

Hallo, scuse for my English. I need to’ login to mysite using a php script. I have trouble with the password. 
I need crypt the clear password in the encrypted to query the table users_field_data and i read that si possible through password-hash.sh but i can not understand how it’s done. Please help me ... thanks 
 

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions