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 Anonymous (not verified) , 10 June, 2016

Database Basic Examples (Select, Merge, Insert ...)

Tags

  • Drupal 8
  • Code
  • Database
  • Drupal 9

Select:
    $con = \Drupal\Core\Database\Database::getConnection();
    $query = $con->select('table_name', 't')
        ->fields('t', ['field_1', 'field_2']);

By editor , 10 June, 2016

Cache Drupal 8 Render Arrays

Tags

  • Drupal 8
  • Code
  • Cache

Cache configuration of a renderer array (Just an exaple)

By editor , 8 June, 2016

Drupal Behaviors - JavaScript and jQuery

Tags

  • Drupal 8
  • Code
  • JavaScript
  • jQuery

What is drupal behaviors ?

Drupal behaviors allow to execute javascpts in particular context and / or pass data from drupal to client side java script.

By editor , 7 June, 2016

Drupal 8 Tags based cache system

Tags

  • Drupal 8
  • Code
  • Cache
  • Module

This system allow you to invalidate drupal cache using a 'tag'

Exapples:

By editor , 4 June, 2016

Inline template with Drupal 8 and Twig

Tags

  • Drupal 8
  • Code
  • Theming
  • Twig

Example 1. Basic inline template

    $output[] = [
      '#type' => 'inline_template',
      '#template' => '{{ yourvar }}',
      '#context' => [

By editor , 2 June, 2016

Drupal Console

Tags

  • Drupal 8
  • Server
  • Shell

 

Drupal Console is the new CLI for Drupal. Drupal Console is a tool to generate boilerplate code, interact and debug Drupal. From the ground up, it has been built to utilize the same modern PHP practices which were introduced in Drupal 8.

By editor , 2 June, 2016

Run a JavaScript for selected pages (using body class)

Tags

  • Drupal 8
  • Drupal 7
  • JavaScript
  • jQuery

Example : Execute JS only in the front page.
This Script run whin the body tag contains class='front'

By editor , 2 June, 2016

Run a JavaScript for selected pages (using body class)

Tags

  • Drupal 8
  • Drupal 7
  • JavaScript
  • jQuery

Example : Execute JS only in the front page.
This Script run whin the body tag contains class='front'

By editor , 31 May, 2016

Change Drupal 8 'Powered By' block

Tags

  • Drupal 8
  • Code
  • Module

You can't change the body of this block fron the user interface. But you can do that using a small custom module using hook_block_view_alter().

Example: in the yourmodule.module

By editor , 29 May, 2016

Find Entity using Drupal EntityQuery

Tags

  • Drupal 8
  • Code
  • Module

You can find any entity using Drupal 8 EntityQuery System.

Pagination

  • First page
  • Previous page
  • …
  • Page 12
  • Page 13
  • Page 14
  • Page 15
  • Page 16
  • Page 17
  • Page 18
  • Page 19
  • Page 20
  • …
  • 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