Drupal Tipps & Tricks

Webserver

Apache / PHP

Module

Calendar

Administration

How to unblock your Drupal 8 administrator account after 5 failed login attempts

Set a new password and truncate the flood (cache):

drush upwd --password="givememypasswordback" "admin"

drush php-eval 'db_query("truncate flood");'

Development

SEO

Add Google Verifcation Code as Meta to your Theme

<theme name>.theme

function <theme name>_page_attachments_alter(&$page) {
    // Setup Google Webmasters Verification Meta Tag
    $description = [
        '#tag' => 'meta',
        '#attributes' => [
            'name' => 'google-site-verification',
            'content' => '<your code here>',
        ],
    ];
    $page['#attached']['html_head'][] = [$description, 'description'];
}
    

Patching

This information deals with applying patches without git. For information on using git to apply patches, please see the git patch contributor guide. For more generic information about patches, please see the Patch section of the Getting Involved Guide.

Applying patches, modifying files according to instructions in the patch file, is the domain of patch programs. There are many different programs with this functionality, some stand-alone (patch), some integrated in IDEs (Eclipse, XCode).

patch -p1 < path/file.patch

https://www.drupal.org/