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 , 26 May, 2016

Make a Link list and Submenu

Tags

  • Drupal 8
  • Code
  • Module

Example:

1. in yourmodule.links.menu.yml
yourmodule.test:
  title: Test
  parent: system.admin_config_development
  route_name: yourmodule.test

By editor , 25 May, 2016

Cache Clearing and rebuilding methods for Drupal 8

Tags

  • Drupal 8
  • Code
  • Server
  • Drush
  • Cache

Site URL

1. Go to Administration > Configuration > Development > Performance
 (/admin/config/development/performance)
2. Click on "Clear all caches"

By editor , 20 May, 2016

Render Custom field with Drupal Renderer

Tags

  • Drupal 8
  • Code
  • Twig
  • Images

Example 1, with FieldPluginBase (\Drupal\views\Plugin\views\field\FieldPluginBase)

By editor , 18 May, 2016

JSON Encode and Decode

Tags

  • Drupal 8
  • Code
  • JSON

Example :

use Drupal\Component\Serialization\Json;
$json = Json::encode($data);
$data = Json::decode($json);

By editor , 18 May, 2016

Call URL on Drupal 8, Like drupal_http_request() on D7

Tags

  • Drupal 8
  • Code

Example :

By editor , 17 May, 2016

Migrate from Drupal7 to Drupal8

Tags

  • Drupal 8
  • Code
  • Drush

Example (basic)

drush migrate-upgrade --legacy-db-url=mysql://user:password@server/db --legacy-root=http://mydrupal6or7site.com

By editor , 11 May, 2016

Add twig template to a custom Module, Block or Page

Tags

  • Drupal 8
  • Code
  • Theming
  • Twig

Step 1. Create your module and Block (/tutoriels/107/create-a-simple-block-programmatically)

Step 2. Add your template usin hook_theme()  (here module name = clock)

By editor , 10 May, 2016

Add Remove Fields Dynamically using Form API and Ajax

Tags

  • Drupal 8
  • Code
  • Form

Example: Add/Remove 'test' Field depending on 'switch' field

By editor , 8 May, 2016

Install and Update Drush on Linux

Tags

  • Drupal 8
  • Code
  • Drush
By editor , 27 April, 2016

Theming : enable Twig templates Debug

Tags

  • Drupal 8
  • Theming
  • Twig

Enable debugging

You enable Twig Debugging in sites/default/services.yml.
(If services.yml does not yet exist; copy default.services.yml and rename it to services.yml.)

parameters:
 twig.config:
  debug: true

Pagination

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