function HOOK_preprocess_page(&$vars) {
global $user;
if (!in_array('administrator', $user->roles) && variable_get('maintenance_mode') == 1 && arg(0) != 'user') {
$vars['theme_hook_suggestions'][] = 'maintenance_page';
}
else if (drupal_is_front_page()) {
$vars['theme_hook_suggestions'][] = 'page__front';
}
}
Other Articles
Redirect Old Domain to New Domain via .htaccess
Install Multiple PHP 7.3 / 7.2 / 7.1 on Ubuntu 18.04 / Ubuntu 16.04
How to make patch file drupal for contributed or custom modules.
Render block and views block drupal 7 programmatically
How to Manually Disable a WordPress Plugin
Nodejs With Xampp
Menu template in drupal 8 for specific customization
Drupal 7 content type template
Render menu on page template in custom way Drupal 8
How to get your MailChimp LIST ID
Easy Way to use tooltip with HTML tags
Import and Export Drupal 8 Views, Or Import and Export any configuration Drupal 8
Send Email using smtp module with Gmail
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)
Drupal 8 Opcache Problem with xampp
page templates for content types in Drupal 8
check if a string contains a specific word with PHP
How you can get Mailchimp API KEY
Html Dom parser to Extract the HTML data from Html page
Prevent to Load a js file on particular page using hook_js_alter Drupal 7
Recursively delete all files of a specific extension
Search word or file Using SSH(Putty)
Recent Posts
Drupal 8: check user is logged in or not in *.html.twig
In the new era the drupal8 twig is introduce, so old basic php drupal hook is not useful in theme templates.
Add text to ckeditor textarea using jquery
In most of case we need to add or fill up form fields using jquery or Js, if you have trobble in loading data in textarea having ckeditor working already then this tutorial helps you.
How to Add a Custom Date Format in Drupal 8
In drupal 8 there is easiest way to add the date format is simply go link for your website
Retrieve the query used in mysql views
we can create the database views for many reason, but if we forget what query you was used to create the views or need to find out using which query results are generating here is the solution:
Send file as Email attachment using hook_mail_alter drupal 7 programmatically (example webform submit)
Hi guys,
In this tutorial we can see how we can send files as attachments in drupal 7 on webform submit using a hook_mail_alter
[SOLVED] PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting
If you get the same error like below in VScode editor then you are the right place to
Redirect Old Domain to New Domain via .htaccess
Usually we develop the site on developement or subdomain and when we finally mirgate the to new domain then some of thing will remain or page redirect happens in sometimes , so In this case .htacc
Create a Flag link programmatically and render flag link in twig template drupal 8
This article is refer to generate the flag link programmatically and render in drupal 8 twig template, before in drupal 7 its was quiet easy to render or generate flag link in just a single line of
Jquery prevent enter to submit form
If you want to prevent the form submit using jquery, then this page helps you to doing this.
Code:
Play Pause HTML5 Video using Jquery
HTML5 video playing on any web page is very easy, in this tutorial we can show you how to add video on html and make it play and pause without using html controls.
Import and Export Drupal 8 Views, Or Import and Export any configuration Drupal 8
Import and Export configuration is the basic protocol to staging the website or production website deployment, In Drupal 7, we need the extra modules to import and export or we can use features mod
How to override different version of Jquery in Drupal 8 using theme
Drupal 8 use its own jquery version by default and if you want to use the other version of jQuery instead of default than this tutorials steps is for you, sometimes we need different version to oth