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

Code

By editor , 13 April, 2016

Remove ctools Autosubmit on Views an From API

Tags

  • Drupal 8
  • Code
  • Drupal 7

Form API :
$form['the_text_field']['#attributes']['class'][] = 'ctools-auto-submit-exclude';
OR
'#attributes' => array('class' => array('ctools-auto-submit-exclude')),

Views (using hook_form_alter)

By editor , 31 March, 2016

Drupal 8 Examples for Developers

Tags

  • Drupal 8
  • Code
  • Module

This is a drupal 8 contrib module allow  you (developer) to find code examples.

By editor , 31 March, 2016

SimpleTest With Drupal 8

Tags

  • Drupal 8
  • Code
  • Module
  • Testing

 

 

 

Drupal Tutorial : https://www.drupal.org/simpletest

By editor , 28 March, 2016

Styel sheet Add / Remove / Override

Tags

  • Drupal 8
  • Code

Example :

# Add a new CSS file:
stylesheets:
  all:
    - layout.css

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)

Pagination

  • Previous page
  • 14
  • Next page
Code

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