drupal

Modify Entity Reference Autocomplete Result In Drupal 8

  • Posted on: 2 July 2017
  • By: admin

In some cases we might need to modify the autocomplete result in Drupal 8. For example, when editing a node, in content authoring section, there is an autocomplete textfield for entering the author for the content. By default, all users will be available in the autocomplete list, but there might be a case when we need to exclude the blocked user from the list. Fortunately, we are able to do that by using one hook function called hook_query_alter.

Tags: 

Add Link To Node In Simplenews Newsletter

  • Posted on: 12 December 2016
  • By: admin

When we want to add newsletter feature to our Drupal website, we might end up finding the simplenews module as the solution. But, there is one problem that so many people asked about in the internet. By default, simplenews will send the whole node content in the body of the newsletter e-mail, not the teaser. Ideally, the newsletter e-mail will contain the teaser or trimmed version of the full content with the link to read it online to our website.

Tags: 

Drupal 8 Table With Sortable Column And Pagination

  • Posted on: 11 September 2016
  • By: admin

In Drupal 8 module development, we can easily create a table with pager. The code might be different from the one we use in Drupal 7, but it's still quite simple. I assume you have already learned to create a simple Drupal 8 "Hello World!" module as explained in there. So, let's start to create the table with pager. For example, we have a routing file, mydemo.routing.yml like the following.

PHP Script For Updating Drupal Core

  • Posted on: 15 August 2013
  • By: admin

Updating Drupal core can be a difficult process because Drupal still doesn't support core update in online way. We must download the core first, extract it, then upload it to our server manually. This process can take more time because of so many manual operations. In order to solve that problem, I try to create a PHP script to make the update process easier. We just need to open a URL with some query string and then the script will download the requested Drupal core to our server. What we need to do next is run the update.php.

Tags: 

Pages