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 , 23 November, 2015

Drupal 8 not Display or Rebuild correctly

Tags

  • Drupal 8
  • Error
  • Settings
  • Server

This is due to file/folder permission. so drupal cant write twig tempory files.

By editor , 23 November, 2015

Drupal Error, Name is not valid for this server.

Tags

  • Drupal 8
  • Error

This is due to trusted host configuration of the serveur. It can produce when you change the domain name or 'trusted_host_patterns'. To resolve the probleme, add your new domain to the DRUPAL_ROOT/sites/SITE_FOLDER/settings.php (Ex: sites/defaults/settings.php)

By editor , 20 November, 2015

Set configuration at the module installation

Tags

  • Drupal 8
  • Code

To set configuration at the module installation

Exemple:
$site_name = \Drupal::config('system.site')->get('name');
// Set the site name.
\Drupal::configFactory()->getEditable('system.site')->set('name', 'My site')->save();

By editor , 20 November, 2015

Return JSON array as resut - Provide Json Interface

Tags

  • Drupal 8
  • Code
  • JSON

You can do that using Symfony JsonResponse.

Exemple 1.
return new \Symfony\Component\HttpFoundation\JsonResponse($array);

By editor , 19 November, 2015

Drupal crash - What can I do !!!

Tags

  • Drupal 8
  • Server
  • Error

As the solution depend on your error, first of all, you must find why drupal crash.

1. First thing is, You must check the serveur error log.
# tail -f /var/log/apache2/error.log

By editor , 19 November, 2015

Create a link with Drupal 8 like l() and url() on D7

Tags

  • Drupal 8
  • Code

Exemple:

By editor , 19 November, 2015

Create the module help page on Drupal 8

Tags

  • Drupal 8
  • Code

Here an exemple : Module name : mymodule

By editor , 19 November, 2015

Get the current page URI on Drupal 8

Tags

  • Drupal 8
  • Code

Here an example to get the current page path programmatically in Drupal 8

    $current_url = Url::fromRoute('<current>');
    $path = $current_url->toString();

By editor , 18 November, 2015

Ajax Form

Tags

  • Drupal 8
  • Code
  • Form

Exemple : Field 'username'

By editor , 18 November, 2015

Save user / temporary data on $_SESSION

Tags

  • Drupal 8
  • Code
  • User

Store data on session.

Example:

$session = new \Symfony\Component\HttpFoundation\Session\Session();
$session->set('var_name', $session->get('var_name',0) + 1);
drupal_set_message($session->get('var_name'));

 

Pagination

  • First page
  • Previous page
  • …
  • Page 20
  • Page 21
  • Page 22
  • Page 23
  • Page 24
  • Page 25
  • Page 26
  • Page 27
  • Page 28
  • 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