Attach multiple files

Attach one file:

$node->field_image->setValue([
	[
	'target_id' => $img_element->id(),
	'alt' => $title,
	'title' => $title,
	],
]);

how to add a few more files via the cycle.

This code does not work :( .

General Drupal Set Up Question - O/S, VirtualBox

I am planning to buy a new laptop specifically so I can run Drupal 8 locally. If I run a VirtualBox, is there any significant difference for running Mac or Windows O/S as the base? VirtualBox comments welcome as well. Any other suggestions on the best way to run Drupal 8 locally? (Note: currently using Windows 7 with wamp to run Drupal 8 - not ideal - drush8, for example, barely works).

Theme D8 contact form email

How should I go about theming the contact form email sent?

I have looked into the Mailsystem and Mime Mail but fail to understand how either of those will help me style the email.

The default e-mail looks like this:
Link to Image

How to get select option value in form drupal 8 ?

$term_name contains taxonomy term names in an array.

$form['category_select'] = [
      '#type' => 'select',
      '#title' => $this->t('Categories'),
      '#options' => $term_name,
];

In submit form i used,

$category = $form_state->getValue('category_select');

Im getting output as numeric value... for example,

I have term name as
drupal,
joomla,
php
in the options list.

Drupal contribution pain points: we need your feedback!

Since its inception, the Drupal Community Working Group (CWG) has dealt with numerous issues related to contributor frustration and burnout. While disagreements are an inevitable (and sometimes desirable) part of the software development process, failure to resolve them in a positive and constructive way can lead to lingering frustrations that undermine people’s ability to work together.

Can't Manage to load Javascript in Drupal 8

So I have been messing around with this for a few hours now, but no matter what I do, I can't seem to get my javascript code to load. Please just look over the code and try to figure out why my silly javascript file won't load. I feel like it either has to do with my library file or my controller that tries to load the javascript. It could also be file location potentially. Thanks in advance for any help and advice!

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x