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 remove the users' blog link? OR How to transform the Blog module into a single user blog?

By default, the Drupal core Blog module is configured as a multiple user blog. This is very often not the desired solution, because the website should just contain a single user or a site wide blog, which isn't differentiated into different user blogs. Unfortunately Drupal core offers no possibilities to change that. Thus each blog entry comes along with a link to the username's blog, what is either not desired - because although multiple users are blogging the blog should appear as a site wide blog - or awkward - because it is always the same username.

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 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;}

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 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 implement Rooms 7.x-1.8 properly - Problem with full calendar library

Drupal Rooms is a booking and room management solution for hotels, vacation rentals and B&Bs. With the change from Rooms 7.x-1.7 to 7.x-1.8 the installation requirements have changed significantly. This article shows you the changes and how to implement Rooms 7.x-1.7 and Rooms 7.x-1.8 properly. Following the below instructions you can avoid the typical problem with the full calendar library.

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


Drupal themes to be compared