Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal-welcome-and-block.png | 66.64 KB | robomalo |
Comments
Comment #1
LAsan CreditAttribution: LAsan commentedAny thoughts about this?
Comment #2
RobLoachNot 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.
Comment #3
robomalo CreditAttribution: robomalo commentedThis 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?
Comment #4
RobLoachThink this is a resolved issue? Drupal has come a long way since 2006.
Comment #5
robomalo CreditAttribution: robomalo commentedI 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?
Comment #6
dmitrig01 CreditAttribution: dmitrig01 commentedWhy not set the view as the front page and make it a page view?
Comment #7
burningdog CreditAttribution: burningdog commentedSolution: 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
Comment #8
jhchnc CreditAttribution: jhchnc commentedThat 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!
Comment #9
burningdog CreditAttribution: burningdog commentedHmmm...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
Comment #10
webchickI think this is now fixed now that #475596: [meta-issue] Fix the unholy abomination that is the welcome screen went in.
Comment #12
ghtry CreditAttribution: ghtry commentedjhchnc,
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.
Comment #13
luco CreditAttribution: luco commentedhey there,
reopening this because even after D7's usability improvements I've stumbled across what seems like an odd behaviour.
after reading a few issues, it just hit me that I could set the Main page content block to not appear in
<front>
.however, even when I disable it the front page still gets that message. stands to reason that I shouldn't: after all I didn't set any nodes on the front page, nor did I say there was room for them there. right?
here's the code before the change:
and after:
can we make it so that removing the Main page content block from the homepage will effectively make this unwanted message disappear?
regards,
Luciano
Comment #14
dcam CreditAttribution: dcam commentedRe-closing this issue. The problem mentioned in #13 should have been brought up in a new issue.