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

URL Redirects: "Fix 404 pages" tab is missing

After the installation of the Drupal module Redirect there is usually the tab "Fix 404 pages" under "URL Redirects". As the designation indicates this function allows you to redirect 404 pages. If this tab does not appear it usually has a very simple reason: The Drupal core module "Database Logging" is not enabled. Being able to reconnect 404 pages, the 404 pages obviously need to be recorded and that's done by the core module "Database Logging". Enable this module and the tab will appear.

Shadowbox gallery displays only the first image on a multi-image field (option "compact")

In 7.x-3.0-beta5 version a new compact parameter has been added to the shadowbox formatter. So if you have an image field (multimage, accepts more than 1 image) and you set its formatter as shadowbox with gallery type and compact checked, you will get a gallery in which only the first image thumbnail is displayed and when you click on it shadowbox is opened and you can view all the images there.

https://drupal.org/node/1107162

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. 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. But processing the following set of measures always helps us to resolve the problem.

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

Enjoy the new comparision function to compare the rating and features of the best Drupal themes

Drupal4U tested and rated the best free and paid Drupal themes for you. We recommend these themes because we think that they incorporate a great design and because they are of high quality. Beside the technology this includes the aspects of administration and online marketing. We believe that a great theme is easy to customize & administer and was built with all aspects of online marketing in mind.

Drupal4U themes section

File entity module: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DATABASENAME.image_dimensions' doesn't exist: SELECT * FROM {image_dimensions} id WHERE id.fid IN (:fids_0); Array ( [:fids_0] => 444 ) in file_entity_file_load() (Zeile 225 von /DRUPALROOT/sites/all/modules/media/file_entity/file_entity.module).

Same for me, after the update to Media 7.1.4, that I did following PSA-2014-001.

Troubleshooting: Impossible to save settings for a new Multimedia asset field

Using 7.x-2.0-alpha4 or media 7.x-2.0-alpha3 of the Drupal media module, you might get the following error while saving the settings for a new multimedia asset field.

"Notice: Undefined index: settings in media_field_instance_validate() (line 382 of [...]\sites\all\modules\media\media.module). The upload destination must be one of the allowed schemes."

Whether you check upload or any other option has no influence. To solve the problem you have to options.

Pages

Drupal themes to be compared