1

The home page of my website contains blocks and views only. Hence, I want to remove both of the following message-

  1. Welcome to my web
  2. No front page content has been created yet.

I tried to add following code as described here but I can still see the message Welcome to my web

unset($page['content']['system_main']['default_message']);
  • Which theme are you using? – CodeNext Dec 14 '16 at 9:25
3

Both are displayed by the different code, hence you need to unset/remove both.

1. Create a separate front page template: In your theme's tempaltes folder make a duplicated of page.tpl.php and rename the dulpicate one as page--front.tpl.php. Now your all other pages will be handeled by page.tpl.php and the only front-page will be handeled by page--front.tpl.php.

2. Edit the page--front.tpl.php template: Now, as you said you are able to remove the message using the code which is in your Question, so go ahead with that.

Secondly, remove the following code from your page--front.tpl.php, which will remove the Welcome...... part.

<?php if ($title): ?>
   <h1 id="page-title">
     <?php print $title; ?>
   </h1>
<?php endif; ?>
  • Little confused... Can you please have a look into page.tpl.php ? – Ravi Joshi Dec 14 '16 at 10:04
  • It is line 169. – CodeNext Dec 14 '16 at 10:06
1

I ran into the same in Drupal 7... this module took care of it for me. Don't know how, but pretty sure the answer above with page.tpl.php will do the trick too.

https://www.drupal.org/project/empty_front_page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.