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.

CommentFileSizeAuthor
#5 drupal-welcome-and-block.png66.64 KBrobomalo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LAsan’s picture

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

Any thoughts about this?

RobLoach’s picture

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.

robomalo’s picture

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?

RobLoach’s picture

Status: Active » Postponed (maintainer needs more info)

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

robomalo’s picture

FileSize
66.64 KB

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?

dmitrig01’s picture

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?

burningdog’s picture

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

jhchnc’s picture

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!

burningdog’s picture

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

webchick’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

ghtry’s picture

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.

luco’s picture

Category: feature » bug
Status: Closed (fixed) » Active

hey 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:

<h1 id="page-title" class="title">Welcome to example.com</h1>
<div class="tabs"/>
  <div class="region region-content">
    <div class="block block-system" id="block-system-main">
      <div class="content">
        <div id="first-time">
          <p>No front page content has been created yet.</p>
          <div class="item-list">
            <ul>
              <li class="first last"><a href="/node/add">Add new content</a></li>
            </ul>

and after:

<h1 id="page-title" class="title">Welcome to example.com</h1>
<div class="tabs"/>
  <div id="first-time">
    <p>No front page content has been created yet.</p>
    <div class="item-list">
      <ul>
        <li class="first last"><a href="/node/add">Add new content</a></li>
      </ul>

can we make it so that removing the Main page content block from the homepage will effectively make this unwanted message disappear?

regards,
Luciano

dcam’s picture

Category: Bug report » Feature request
Issue summary: View changes
Status: Active » Closed (fixed)

Re-closing this issue. The problem mentioned in #13 should have been brought up in a new issue.