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 , 10 October, 2016

Create a custom Content Entity on drupal 8 (Full)

Tags

  • Drupal 8
  • Code
  • Entity

This is a full Example of the Entity 'Vehicle' with user interfaces for:
- Actions (Create, Edit, Delete)
- Listing builder
- Entity settings pages
   - Manage fields
   - Manage form display
   - Manage display

 

By editor , 10 October, 2016

Create a custom Content Entity on drupal 8 (Basic)

Tags

  • Drupal 8
  • Code
  • Entity

Drupal 8 has two type of entities, ContentEntity and ConfigEntity. Content entity is based on database table and config entity is based on Drupal config table.

By editor , 4 October, 2016

HTML Entity Decode and Encode

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • PHP

Basic php and drupal 7 / 8 Examples

1.
$string_out = html_entity_decode($string, ENT_QUOTES, 'UTF-8')
//Do not forget ENT_QUOTES and 'UTF-8', otherwise quotes will not decodes.

By editor , 4 October, 2016

HTML Entity Decode and Encode

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • PHP

Basic php and drupal 7 / 8 Examples

1.
$string_out = html_entity_decode($string, ENT_QUOTES, 'UTF-8')
//Do not forget ENT_QUOTES and 'UTF-8', otherwise quotes will not decodes.

By editor , 4 October, 2016

Drupal Utility Components and functions

Tags

  • Drupal 8
  • Code
  • Utility

Drupal Utility list

ArgumentsResolver, ArgumentsResolverInterface, Bytes, Color, Crypt, DiffArray, Environment, Html, Image, NestedArray, Number, OpCodeCache, Random, Rectangle, SafeMarkup, SortArray, Tags, Timer, ToStringTrait, Unicode, UrlHelper, UserAgent, Variable, Xss

By editor , 30 September, 2016

Edit and Update Entity schema on drupal 8

Tags

  • Drupal 8
  • Code
  • Entity

Add a new field:

Example 1 Automatic update:

1. Update baseFieldDefinitions() of the Entity.
2. Apply update from a mymodule_update_N(). Ex:

By editor , 30 September, 2016

Alter a view. Edit view result programmatically

Tags

  • Drupal 8
  • Code
  • Views
  • Drupal 9

Example : Change title

By editor , 30 September, 2016

Create HTML Table. render and theming

Tags

  • Drupal 8
  • Code
  • Theming

Example : Table.

$header = ['#','Name', 'Mail'];
$data = [
  [1,'Name 1', 'Mail1@example.com'],
  [2,'Name N°2', 'second@example.com'],
];

By editor , 30 September, 2016

HTML List render and theming

Tags

  • Drupal 8
  • Code
  • Theming

Example : List

By editor , 29 September, 2016

Execute a drush command programmatically

Tags

  • Drupal 8
  • Code
  • Drush
  • Drupal 7

Methodes:

drush_invoke (For the current site)
drush_invoke($command, $arguments = array());

drush_invoke_process
This creates a new process in a new Drupal instance. There for you must specify the site alias.

Pagination

  • First page
  • Previous page
  • …
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • Page 12
  • Page 13
  • Page 14
  • Page 15
  • …
  • 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