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 , 20 March, 2016

Drupal 8 Theming with Twig

Tags

  • Drupal 8
  • Twig
  • Theming

Print : {{ variable_to_print }}
Code : {% codes %}
Comment : {# Comments #}
 

By editor , 26 January, 2016

Add custom class to the elements of a View

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Views
  • Theming

Example:

By editor , 26 January, 2016

Add custom class to the elements of a View

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Views
  • Theming

Example:

By editor , 18 January, 2016

Get site Name & Host name (site address)

Tags

  • Drupal 8
  • Code

Site Name:    
$site_name = \Drupal::config('system.site')->get('name');
 

Site Address (Host)
$site_addr = "http://" . \Drupal::request()->getHost();

By editor , 18 January, 2016

Create a simple Block programmatically

Tags

  • Drupal 8
  • Code
  • Module
  • Plugin

In drupal 8 block is part of the plugin system.

Step 1. Create a simple module like this.

By editor , 15 January, 2016

Form redirection on submit

Tags

  • Drupal 8
  • Code
  • Form

Example : (Insert this line in to your form submitForm() methode)

Redirect to the user page ( Redirection on form submit)
$form_state->setRedirect('user.page');

By editor , 15 January, 2016

Show a Form on another page

Tags

  • Drupal 8
  • Code
  • Form

 

Example :  Display user login form on a page

By editor , 15 January, 2016

Create a Form with Drupal 8 using Form API

Tags

  • Drupal 8
  • Code
  • Module
  • Form
  • Drupal 9

Step 1:  Create a module. (Example)

By editor , 12 January, 2016

Set the initial Auto Increment value

Tags

  • Drupal 8
  • Code
  • Database

Example:

  $con = Drupal\Core\Database\Database::getConnection();
  $start_value = 100000;
  $query = "ALTER TABLE {the_table} AUTO_INCREMENT = $start_value";
  $con->query($query);

By editor , 12 January, 2016

Display contents using Drupal8 Render API

Tags

  • Drupal 8
  • Code
  • Theming

 

Render arrays

 

Pagination

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