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 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 create a Drupal view with future events / dates of nodes

All you have to do is create a new view that shows content of type 'event'... set that on the first page of creating your view. Make sure you check the 'block' option at the bottom - it's up to you whether you also want to create a page display or not, that's checked by default. Also, before moving onto the second page, make sure that your view is a list of 'fields' rather than 'teasers'.

How to create a Drupal view with future events/dates

How to choose, download and install additional themes?

Themes allow you to change the look and feel of your website. This howto will give you step-by-step instructions how to choose, download and install a theme.

List of Drupal themes

"From address" doesn't work in Forward Module. How to solve the issue?

If the "From address" is left blank the site email address is used instead of the address entered by the user. This howto shows you how to solve the issue quickly.

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 change the language attribute href (html lang="xx") without extra installations

Sometimes it is convenient to change the language definition of a website without the installation/configuration of extra modules/languages. For example if you create a copy of a very simple informational website and you want to change its language without touching language settings/modules.

The language attributes typically can be found in the following file:

/core/includes/theme.inc

$variables['html_attributes']['lang'] = $language_interface->getId();

Language

Pages

Drupal themes to be compared