Drupal Howtos

A how-to is a short description of how to accomplish a specific task. This is a compilation of Drupal related howto's which I provided to friends or which I applied myself. Targeting the Drupal beginner they provide simple and detailed step-by-step descriptions with pictures.

How to automatically sort uploaded images and files in Drupal 7 (Multiupload)

By default, the multiupload imagefield and filefield don't sort the uploaded items by name. If you upload many images and files to your website, this can be a serious issue, since you have to sort the items manually. In Drupal 7, the issue can be resolved with a very simple change in the Multiupload Filefield Widgett (7.x).

How to make a click-to-call link for mobile Devices only using HTML/CSS

<div class="mobiletel"><a href="tel:+xxxxxxxxx">(00xx x) xxx xx xx</a></div>
<div class="desktoptel">(00xx x) xxx xx xx</div>

@media only screen and (max-device-width: 480px) {
.desktoptel {display:none;}

@media (min-device-width: 481px) {
.mobiletel {display:none;}

Drupal "Fatal error: Allowed memory size of 134217728 bytes exhausted when clearing the cache"

Frequently after the change of a server or hoster or during the build-up of a Drupal site you might run into the "Fatal error: Allowed memory size of 134217728 bytes exhausted when clearing the cache". This usually isn't as dramatic as it looks like. The most common cause for this problem is a php memory limit that is too low. Thus the solution is to increase the php memory limit. If you increase the limit to 256M or even 512M you will certainly be without any php memory limit troubles with a standard Drupal installation.

How to get the file path of an image as replacement patterns in views

You can achieve that by using the Image URL Formatter module.

This module adds an url formatter for image field. Then you can output the image url directly.


Howto change the (default) settings of the Drupal Felxslider (jquery.flexslider.js)

If you use the Drupal Flexslider module or any other implementation relying on the jQuery slider plugin, you can easily change the (default) settings by editing jquery.flexslider.js.

Edit the .js file and search for "//FlexSlider: Default Settings". As you can see below, you can change all the default settings such as "animationSpeed" and "slideshowSpeed" in this section. If you are using a minified version (jquery.flexslider-min.js) don't forget to update it!

Drupal module XML Sitemap generates wrong URL

If you move your Drupal site from one server to another it might happen that the URLs generated by the module XML Sitemap are wrong. This is also the case after clearing cache, running cron or regenerating the sitemap. Although it is not a bug, it is certainly a not well "thought trough" issue, because one would expect, that at least the running of cron or the regeneration of the XML sitemap should update the XML sitemap to the new URL.

Drupal XML Sitemap

How to add a custom html.html.twig to your Drupal 8 theme

The html twig file (html.html.twig) in Drupal 8, what was previously the html.tpl.php in Drupal 7.

If there is no html.html.twig in your theme folder /themes/custom/THEME-NAME/templates, just copy the default html.html.twig file from /site/core/modules/system/templates to this folder.

Thereafter you can edit the file to make the desired modifications. Thus you can for example overwrite the {{ html_attributes }}, what can be an efficient mean to change the language tag (html lang="en") without installing language modules.

Twig and Drupal

How to use Drupal on a Temporary URL (Hosting)

If you move or create a Drupal site when the domain is not yet available/propagated you have to modify some Drupal settings to make your website work. This short howto shows you how you can do so with some simple edits.

Source: This article was written based on the GreenGeeks specifig article https://kb.greengeeks.com/2559/using-drupal-on-a-temporary-url/

How to troubleshoot white screen of death (WSOD) after admin login – move of Drupal website

In our experience it happens from time to time that one gets a "white screen of death" - short WSOD - after the login with the admin account. Most frequently this happens after the move of a Drupal website to a new host or an upgrade to a new release. This is of course very odd and can lead to a very time consuming troubleshooting. Unfortunately we did not find out the precise causes and we couldn't find clear answers either.


Drupal themes to be compared