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 , 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.

By editor , 27 September, 2016

Get Theme details (Name, Regions, Libraries ...)

Tags

  • Drupal 8
  • Code
  • Theming

Get current theme.

$theme = \Drupal::theme()->getActiveTheme();

Theme name:

$theme_name = \Drupal::theme()->getActiveTheme()->getName();

By editor , 26 September, 2016

Drupal 8 breadcrumb functions (menu_get_active_trail, and menu_link_get_preferred ...)

Tags

  • Drupal 8
  • Code

Those functions [ menu_set_active_item(), menu_set_active_trail(), menu_get_active_trail(), menu_link_get_preferred() ] are removed on D8 and replaces with drupal 8 service. You can use following example to get data and to edit.

Example :

By editor , 16 September, 2016

Drupal 8's HTML elements render and themes

Tags

  • Drupal 8
  • Code
  • Theming

Use custom twig template or alter an existence.

Create a custom module then use hook_theme()

By editor , 29 August, 2016

Change Date format on Views BEF

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Views

There are several methodes.

Change date format Using custom module.

By editor , 29 August, 2016

Change Date format on Views BEF

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Views

There are several methodes.

Change date format Using custom module.

By editor , 26 August, 2016

Tips for Form API of Drupal 8

Tags

  • Drupal 8
  • Drupal 7
  • Code
  • Form

Add html after a field

(#field_prefix and #field_suffix).

By editor , 26 August, 2016

Tips for Form API of Drupal 8

Tags

  • Drupal 8
  • Drupal 7
  • Code
  • Form

Add html after a field

(#field_prefix and #field_suffix).

By editor , 24 August, 2016

Get Entity, Node, Taxonomy from URL Path

Tags

  • Drupal 8
  • Drupal 7

Drupal 8

 

Drupal 7

Get the node
$node = menu_get_object();

Get Path alias
$alias = drupal_get_path_alias();

By editor , 24 August, 2016

Get Entity, Node, Taxonomy from URL Path

Tags

  • Drupal 8
  • Drupal 7

Drupal 8

 

Drupal 7

Get the node
$node = menu_get_object();

Get Path alias
$alias = drupal_get_path_alias();

Pagination

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