Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Tutorials - Drupal

By editor , 8 December, 2015

Form API Error - illegal selection

Tags

  • Drupal 8
  • Form
  • Code

Most likely, this error is due to dynamicaly changed options list.

If you want to change the values of the options list, You must add:
'#validated' => TRUE

By editor , 8 December, 2015

Database LIKE condition

Tags

  • Drupal 8
  • Database
  • Code

The like condition syntax is:
$query->condition('field_name', "%" . $query->escapeLike("The string") . "%", 'LIKE');

Example:

By editor , 7 December, 2015

Drupal Mysql / Database Data types

Tags

  • Drupal 8
  • Database
  • Drupal 7

Link : https://www.drupal.org/node/159605

By editor , 7 December, 2015

Drupal Mysql / Database Data types

Tags

  • Drupal 8
  • Database
  • Drupal 7

Link : https://www.drupal.org/node/159605

By editor , 7 December, 2015

Add JavaScript to a module

Tags

  • Drupal 8
  • Theming
  • JavaScript

Add JavaScript as libraries

Like a CSS, You can add a JS as a librarie

By editor , 6 December, 2015

Create Taxonomy Vocabulary programmatically on Drupal 8

Tags

  • Drupal 8
  • Code
  • Taxonomy

Exaple:

By editor , 6 December, 2015

Create a module setting page link on Drupal 8

Tags

  • Drupal 8
  • Code

Module name : simple_analyse

By editor , 5 December, 2015

Create a custom permission in Drupal 8

Tags

  • Drupal 8
  • Code
  • Permission
  • Drupal 9

Example with a module 'mymodule'

Step 1.
Create if not exist yet, mymodule.permissions.yml (root of mymodule)
Add your new permission like:

By editor , 5 December, 2015

Update a node / Entity programmatically in Drupal 8

Tags

  • Drupal 8
  • Code
  • Node

Update a node:

Example 1 : Update title
$node = \Drupal\node\Entity\Node::load($nid);
$node->setTitle('The new Title')
$node->save();

By editor , 4 December, 2015

Create a node With date field

Tags

  • Drupal 8
  • Code
  • Node

It is same as normal node creation but must be in format "Y-m-d" (YYYY-MM-DD)

Example:

Pagination

  • First page
  • Previous page
  • …
  • Page 18
  • Page 19
  • Page 20
  • Page 21
  • Page 22
  • Page 23
  • Page 24
  • Page 25
  • Page 26
  • …
  • Next page
  • Last page

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer