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 , 15 May, 2017

Git Tags

Tags

  • Drupal 8
  • Code
  • Git

Add remove git tags.

Create a tag

git tag <TAGNAME>

Push tag

git push origin <TAGNAME>
git push --tags

Pull tags

git tag -l
git checkout tags/<TAGNAME>

By editor , 11 May, 2017

YAML or JSON

Tags

  • Drupal 8
  • Code
  • JSON
  • YAML

Yml vs Json

A make a small test to test YAML vs PHP performance. The result is:

By editor , 24 April, 2017

Drupal 8 Cache contexts

Tags

  • Drupal 8
  • Code
  • Cache

Drupal 8 shiped with a powerfull cache API able to set cache according to a context. correct usage of this cache improve the site preformence greatly.

https://www.drupal.org/docs/8/api/cache-api/cache-contexts
https://www.drupal.org/node/2451661

By editor , 24 April, 2017

Memcache - Install memcached on linux and Drupal.

Tags

  • Drupal 8
  • Code
  • Cache
  • Server

Memcache is caching server allow you to incrise and have great performence on your site. Drupal and memcached work very well and here the full tutorial you need to install and setup memcache server and your drupal instance.

By editor , 29 March, 2017

Few Tips to create a custom module

Tags

  • Drupal 8
  • Code
  • Module

 

Check module exist

if (\Drupal::moduleHandler()->moduleExists('my_module')) {
    $message = 'Module exist.';
}
else {
    $message = 'Not exists.';
}

 

By editor , 16 March, 2017

Avoid Spam form submissions - (Easy way of form Anti-Spam)

Tags

  • Drupal 8
  • Code
  • PHP
  • Form
By editor , 3 March, 2017

Create a View Plugin Without using Database field

Tags

  • Drupal 8
  • Code
  • Module
  • Views

Step 1. Create a custom module and add the HOOK hook_views_data_alter(&$data). Here module : mymodule

Step 2.

By editor , 20 February, 2017

Override 40x System error pages on Drupal 8

Tags

  • Drupal 8
  • Code

You have several mthodes to override 403 / 404 System pages.

Method 1. Set 403 / 404 pages.

You can set the 403 /404 page on "Basic site settings" page
Admin -> Configuration -> System -> Basic site settings
Path /admin/config/system/site-information

By editor , 10 February, 2017

Render a Render array to HTML code.

Tags

  • Drupal 8
  • Code
  • Module

Example :

$result =  array(
  '#markup' => 'Hello. This is my First Page',
);
$renderer = \Drupal::service('renderer');
$html = $renderer->render($result);

 

By editor , 10 February, 2017

Insert a view on a custom page or block

Tags

  • Drupal 8
  • Code
  • Views

This tutorial show toy how to insert an existing views into a custom page or custom block.

 

Pagination

  • First page
  • Previous page
  • …
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • …
  • 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