Friday, October 26, 2012

How to hide "No front page content has been created yet" in the Drupal Frontpage

And easier solution is to unset or to empty the proper theme variable either in hook_preprocess_page or in page.tpl.php
In hook_preprocess_page() ...
<?php
 
if($variables['is_front']){
   
$variables['title'] = ''; // This is optional ... it removes the default Welcome to @site-name
   
$variables['page']['content']['system_main']['default_message'] = array(); // This will remove the 'No front page content has been created yet.'
 
}?>
In page.tpl.php, put the following somewhere below the big commented section at the beginning of the file ...
<?php
 
if($is_front){
   
$title = ''; // This is optional ... it removes the default Welcome to @site-name
   
$page['content']['system_main']['default_message'] = array(); // This will remove the 'No front page content has been created yet.'
 
}?>

1 comment:

  1. For those who are looking for one page wordpress themes I can advise you to check one site I use and am happy one page wordpress themes

    ReplyDelete