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

Drupal 8

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

 

By editor , 12 January, 2016

Install Drupal 8 - Requirements

Tags

  • Drupal 8
  • Server

System requirements:

Database

  • MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine,
  • PostgreSQL 9.1.2 or higher with PDO,
  • SQLite 3.6.8 or higher

 

By editor , 11 January, 2016

Useful Drush commands

Tags

  • Drupal 8
  • Drupal 7
  • Drush
  • Shell

To handle drupal with drust, First of all, you must install drush, and execute drush command from your drupal instalation folder.

By editor , 6 January, 2016

Install drush on Widows

Tags

  • Drupal 8
  • Drupal 7
  • Windows

Install drush on Windows
(link : http://www.drush.org/en/master/install-alternative/)

Pagination

  • Previous page
  • 17
  • Next page
Drupal 8

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