Download & Extend

Drupal welcome message displays if the front page only has blocks and views

Project:Drupal core
Version:7.x-dev
Component:node system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Here's my example:

I have blocks and views on my homepage. That's all I want and not nodes needing "Promoted to front page." Without a node published to the front page, you get the Drupal welcome message. On other pages you get the message saying nothing's posted in that category, even with views showing you content. Basically, I think if anything other than a node is printed out of $content, you should not have these messages. It should behave just like a posted node.

Comments

#1

Version:x.y.z» 7.x-dev

Any thoughts about this?

#2

Not quite sure what is being asked here.... Only display the welcome message when nodes arn't being displayed? To me, that seems irrelevant whether or not nodes are being displayed. The welcome message is displayed on the front page, whether or not nodes are on there.

#3

This is a verrry old issue. If I remember correctly, the Drupal welcome message would appear on the home page, even if I had block or view displaying in $content on . I believe I remedied this by overriding the frontpage with views. My feelings back then were probably frustration or confusion because, in my mind, I had created content and the welcome message was being displayed.

Since you ask, what are your thoughts LAsan?

#4

Status:active» postponed (maintainer needs more info)

Think this is a resolved issue? Drupal has come a long way since 2006.

#5

I just installed the latest versions of Drupal and Views, added two test nodes, created a block with views, and told it to display only on the front page. See the attachment and you will see the welcome message still appears. Should this be the understood behavior, requiring a view override, a node to be set as the front page, or promote content to the front?

AttachmentSizeStatusTest resultOperations
drupal-welcome-and-block.png66.64 KBIgnored: Check issue status.NoneNone

#6

Status:postponed (maintainer needs more info)» closed (works as designed)

Why not set the view as the front page and make it a page view?

#7

Title:Drupal welcome message» Drupal welcome message displays if the front page only has blocks and views
Status:closed (works as designed)» closed (fixed)

Solution: go into your theme folder, duplicate page.tpl.php and rename the duplicate to page-front.tpl.php
Edit the file and comment out the following line:
print $content

#8

Status:closed (fixed)» needs work

That doesn't work because the blocks are in the content of the homepage. It's weird, because I've added pages, stories, and still this message. I've added "stuff", ya know?

Official docs say: The welcome message is hard coded into Drupal's core files so it is not possible to have your front page set to 'node', have no alias, have no nodes promoted, and not have this message without changing the source code. (http://drupal.org/node/61233)

For a serious website, this is not good enough. So, go to line 1762 of node.module. If you know what to do, then do it!

#9

Hmmm...ok, try this: create a new block region, and put your block into that region. Then, in your template file, put it just below where $content is printed. Then comment out the print $content; line in page.front.tpl

#10

Status:needs work» fixed

I think this is now fixed now that #475596: [meta-issue] Fix the unholy abomination that is the welcome screen went in.

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#12

jhchnc,

THANKS for that tidbit of information. I hunted for hours searching for where the welcome message was hardcoded. The reason I wanted it deleted was because using 2 oppositely configured blocks, 1 for anonymous, 1 for authenticated users was the approach I was hoping for. Your solution for editing *site-root*/modules/node/node.module around line 1762 was the perfect fix. I just erased everything in the else block excepting to make it say $output = '';

On a side note this hassle would have been much easier had drupal of provided an administration checkbox to turn off the welcome message. However I suppose most webmasters would have some PHP knowledge to get things to work how they need them to. This is not the first core code modification *hack dare I say?* that I have used to get drupal to behave how I need. I am glad I stumbled on your post, thanks a million.