The following code will add a meta tag in the head of the html to automatically refresh Drupal page in browser.
You can add the following code to your theme’s hook_preprocess_page
in the template.php
file to add a meta tag that will refresh the browser every 15 minutes. In this case I needed it for the home page only so I have a condition in the preprocess hook.
/**
* Implements hook_preprocess_page().
*/
function YOURTHEME_preprocess_page(&$variables) {
// Test for Homepage and add meta tag to head
if (drupal_is_front_page()) {
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'http-equiv' => 'refresh',
'content' => 60*15,
)), 'refresh-page');
}
}
Cheers!
Prezado, por favor, funciona no Drupal 8?