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.
By Chi Loop on
I searched the forum and didn't find a direct answer for this.
I would like to remove the welcome message without promoting anything to the home page. I wouldn't like to install views or use front_page or any other module. I would just like to know where can i comment out or remove the code (probably if condition) that causes drupal to display this message.
Thanks
Comments
Create any type of content,
Create any type of content, then go to Administer > Site configuration > Site information, and set the front page to "node/1".
defaulted..
That content is hardcoded in node.module when there's no any promoted node. IF you don't want to promote, than you will have to edit the node.module file.
Thanks. It works. Details on function node_page_default()
Thanks Ilo. It worked!
For the rest who might ever face this problem with what part is to be edited, open node.module and search for the function node_page_default().
I replaced:
with
Maybe there is a better way to comment this code out or something, if so, do reply telling how to do so for the benefit of all. This worked for me. Cheers (and thanks Ilo)
for setups where..
you can't modify the code, and don't want to promote a node to the front page, there's also another option when the locale module is enabled. You may translate the text of this page to empty strings, so when it gets rendered you can show a blank page when a user reaches the default page.
don't need to go comment out all this, just set this
in "node.module" line 1751
"$output = ' ';
$num_rows = false < == change this to "true"
the default message will be gone for good but again, everytime you upgrade your core you need to edit this portion.
cheers,
s
It works.
Hello,
Changing the value from false to true works for me. However, this modification should be rolled-back whenever I am doing an in-place upgrade.
Thank you.
Got module errors...
Hi, Chi Loop
I tried this, and ended up with:
Parse error: syntax error, unexpected T_CASE in /var/www/domains/medianewday.com/docs/modules/node/node.module on line 78
Fatal error: Call to undefined function node_get_types() in /var/www/domains/medianewday.com/docs/includes/theme.inc on line 923
where could I've gone wrong?
cheers
-Vallab
easy.
What you are doing wrong is hacking core.
Don't do that unless you are a PHP expert.
And a PHP expert would know that you don't hack core.
The suggested change here is BAD and also quite probably out-of-date with the current version of Drupal.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Don't modify core files for
Don't modify core files for something so trivial, every time you upgrade you will have to make the change again. The more you hack core files the harder it will be to upgrade and apply patches.
If you don't want to have a front page list of nodes, then change the front page to "node/1" (or any node you like) instead of "node". This will make your front page use an existing node you've created instead of showing a list of nodes (or the welcome text).
If you do want to promote nodes to the front page then the welcome text will be replaced as soon as you promote your first node.
...
The contrib module front page can also help with this.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Thanks. Makes sense
I didn't think of that Rowanw. It makes absolute sense. I'm going to uncomment the changes in node.module and change the front page to node/x as you say and also check out the front_page module.
Hmm...
Then why do I have a site where one role is getting the "Welcome to your new Drupal site!" even when there are 3 nodes promoted and showing first? This does not happen on the user/1 account, or other roles, just the role for the board of directors.
One strange thing I see is that I have the post settings set to display up to 10 nodes on the front page. There are only 3 promoted at the moment. The default "Welcome" page is showing as page 2. Could this be a pager_query or db_rewrite_sql bug?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
possibly?
if the users still getting the default text don't have access clearance to the promoted nodes that could be why. i think. maybe.
Indeed
I got around this by deleting the entries in node_access and adding them to the "all" realm. The problem went away after that. However, if anyone ever comes back in and rebuilds permissions, it will have to be done again.
NancyDru
As today, I'm still
As today, I'm still experiencing this problem (Drupal 5.2).
I've been using the CCK and Views modules to setup my site. Three blocks appear on the frontpage but the welcome message is still there.
Things I've done:
- Checked whether anonymous users have permissions to access content.
- Cleaned up the node_access table (as described at http://drupal.org/node/64114).
But none of these things work.
Some side questions:
- Why should I promote a node to the frontpage if all my content is organised in blocks?
Thanks for any help.
=-=
seems to me, that instead of orgainizing your content in sidebar blocks, you should use the panels.module so that you can add blocks to the content area ?
a bit of a trick would be to create a node, with a 1x1 pixel image on the node, and setting this node to be the home page in administer -> site information, doing so will put a node on the front page that is essentially blank and as such will allow you to run your blocks in side bars without promoting anything to the front page.
See above
That's a good tip, VM.
If you read my post above, you'll see that, in my case, there are three nodes promoted and I still get the welcome page for one role. Any ideas?
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
=-=
My first guess would be the node access table being out of whack. Though I know you are drupalized enough to have checked that, so mentioning it seems fruitless. I"ve never seen a situation in my own installs where the problem was for a "role" other then anon. Will keep your problem rolling around my mind for a bit and see if I can think of something while waiting for todays NFL games to begin.
E-A-G-L-E-S .... EAGLES!
Yes, I checked it
Yes, I checked it and it looks okay to me. I have been to chicken, though, to rebuild permissions. I guess I need to get over that.
The Sitedoc access check says everything is reasonable, but I have to believe that it is something like you say.
This is certainly a first for me. I've never seen this happen for any roles once I built a front page. But it's also the first time I've used Taxonomy Access Control too.
NancyDru
=-=
And I assume you have combed over the TAC settings ?
Yes
Yes, I have, although I can't see any reason why they would cause this. I've also gone through the node module code and can't see how this could even happen.
I did just now rebuild permissions and it makes no difference.
It's almost acting like the node module is getting called twice; the first time correctly building the front page, then the second time creating the Welcome page. But that doesn't make sense either. And yes, I did stick some debugging code into the node module but it hasn't shed any real light on the problem.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Same Here
I have the same problem Nancy. This never happened before. This is also the first time I used the Taxonomy Access module. Something must have happened when the install modified the database. If you come up with some kind of answer, please let us know.
I'm not running the Taxonomy
I'm not running the Taxonomy Access module and I'm also having this problem. So I think you can't blame this module.
Yesterday, I did a fresh Drupal 5.2 install and installed the following modules:
- CCK
- Link
- Pathauto
- Token
- Views
- Imagefield
- Feedburner
- Flickr
- Google Analytics
- Keys_api
But I'm sure Feedburner, Flickr, Google Analytics and Keys_api have nothing to do with it because I had the problem before installing these modules.
Hmm...
The site I'm having this on is a fairly simple one. The only common module I can see is Views.
NancyDru
It's just because there are
It's just because there are no nodes promoted to the frontpage.
Once you promote a node, it's solved. You could create a simple content type (with only a title, which is required) and insert one piece of content which you promote. Then with CSS or a custom template you could hide this node. Ugly solution, but it works.
I'm still waiting for a better solution...
Not for me
All of my sites have something promoted to the front page. This one having the problem has three nodes promoted. They show as one would expect, but then it shows the pager, and the welcome page is page 2.
NancyDru
Already Promoted
I already promoted three stories to the front page and users with authenticated or anonymous roles still see the default welcome page. Administrative roles have no problem seeing the promoted content in the front page. The problem is somehow related to users within certain roles only, even when they have access to content.
Still no answer to this
Still no answer to this issue... And it seems many people deal with it...
To be honest I'm a bit disappointed in the Drupal support on this forum. I know I can't blame anyone, but I wonder why it's so hard to get quick and appropriate answers to your questions.
=-=
@ bc173: With regards to your idea of a better solution ? have you tried the frontpage.module? There is a specific reason that the drupal welcome message is in place. Especially for new users. Because it isn't a page, it can't just be shut off. You must work around it using one of the methods outlined in the handbook ( http://drupal.org/node/140751 ) and in this thread. You've even coughed up one of your own. Though, I don't see why you would need a custom content type, you could simply add a node as the default front page in administer -> site settings -> default front page. then use css to hide the node title. This is a known method and it works quite well without alot of fuss and one css declaration addition.
Keep in mind too: The forums are volunteer, you have alternative ways to gain answers, including but not limited to hiring a consultant and jumping into the IRC support channel. Being "disappointed" in people who are trying to help simply because they haven't provided an answer "you like" doesn't necessarily mean you didn't get an answer.
Well...
VM, I think you know I know about these solutions. I've never had this problem before, but I am now. This is the first site I've done that uses TAC and the problem is only showing up for one role, even though the front page is open to everyone, including anonymous users. I don't see anything in the TAC settings that looks unusual. The fact that it is being put on a second page even though the first page is not totally full baffles me.
NancyDru
=-=
I know. I wasn't addressing your situtation. Try as I may, I can't reproduce your situation either, Though I have not gone as far as to install TAC on any sites to try and reproduce. By chance have you tried to reproduce on a test installation replicating the site you are having a problem with?
This thread seems to have gone in two totally seperate directions with two different issues from what I can tell. Those who just don't want the Drupal welcome page, or want to avoid it without promoting nodes to the front page and those who are getting the welcome page when they shouldn't be as you are.
:-)
No, since I don't own the site, it is difficult for me to get a backup to load into a test site. And it's too big to try to cut and paste. If I get a few spare minutes, I may try to reproduce just the front page and TAC settings.
NancyDru
=-=
: ) I meant just a test site, not a complete duplicate just another site (test) with TAC. Could be something elusive with that module.
Another thing that has just crossed my mind, the role that is problematic, what if you edited/altered the name of that role? problem still there?
Not yet
No, I haven't tried changing the name. I'll try to do that today. Maybe I can set up a test site with just the front page.
NancyDru
wow..
-----
To be honest I'm a bit disappointed in the Drupal support on this forum. I know I can't blame anyone, but I wonder why it's so hard to get quick and appropriate answers to your questions.
------
I'm impressed with this kind of answer. After several replies telling about how to remove the front page information, you still claim there's no help in the forums..
Let's start again, if you want.. Here's my help, start a new fresh drupal setup, untill you recongnize wich of the modules is breaking the permissions, and then maybe we can add a workaround, but I guess it's impossible from your post situation with several modules and I guess some configuration settings yo give a solution, neither more help than what was done. Even if we decided to try to reproduce to really understand where the problem is, we still don't know what your configuration is, so we can reach another errors instead of helping you.
Anyway, the main purpose of the initial page, the front page, is to show a welcome message for a blank content view. If you have set your content in blocks or categories, what do you expect to appear in a front page? and how do you expect drupal deals with that? You are telling not to promote a node as they are categorized, then.. what must be shown in the front page of your site?
I wonder why some people forgets to thank the others effort, You have turned crazy to MisUnderstood but haven't said any word about spending his time with you. I could be a bit dissapointed also with some people comming to drupal and requesting help withouth first doing a search in the site, but I would never say a word about it :)
(Better if I stop before looking like a trol.. :D )
See my solution above
Nodes 3, 4, and 5 are my promoted nodes.
@bc173: A big part of this is because of the wide variety of ways in which a site may be implemented with Drupal. I'm fairly certain this is a case of shooting myself in the foot (with TAC), but I have no idea where the trigger is.
NancyDru
Theme page-front.tpl.php
Just create a custom front page for your theme. Create file 'page-front.tpl.php' in your theme directory with the code to generate your desired output. Easiest way is to copy 'page.tpl.php' and remove code that generates the welcome text.
If you are using the
If you are using the PHPTemplate engine.
subscribing
subscribing
Creating page-front.tpl.php
Creating page-front.tpl.php alone did not remove the welcome message, I had to remove:
...and just use my own regions. Not sure how else to do it, I couldn't figure out where the welcome message was coming from, it's not in page-front.tpl.php.
Node
It usually comes from node.module.
NancyDru
I did this and it seems to
I did this and it seems to work, Drupal 5.2, PHP5
create a node with php code
Make it so that it is promoted to the front page, so when Drupal calls that it redirects to another page without the visitor even noticing.
careful
Drupal has a replacement for teh header function because it's possible to confuse Drupal with that.
NancyDru
my private hack 4 this W.
I have had the same problem with this additional "Welcome" data.
It occured only with user defined roles.
In page: Administer > Site information [admin/settings/site-information]
I have changed: "Default front page:"
from: "node"
to: "frontpage"
This View can be found in: Administer > Views [admin/build/views]
(...if you are using Views, but propably you do...)
Hope this helps.
veriKami
(dziewczynka w organizacji)
Great fix!!
Thanks for posting this.
So simple yet so powerful.
The only requirement is that you have to have the Views module which I do and it was so easy.
Thanks again.
This worked for me!
This worked GREAT for me. I already had a block set up in Views that was pushing stories to this front page, so all I had to do was add a page to the view, then add a path called "Home" to that view page. Then go to admin/settings/site-information and change it to Home.
Then just remove my block from the front page, as it was not needed anymore.
beautiful, it works for me.
beautiful, it works for me. thanks.
Hi,I had the same problem.
Hi,
I had the same problem. I found a better way to do without change code. Here is how I did
I create a story (you might want to try page that's fine) and check it to appear on the frontpage. Now the welcome page is gone but only thing I stucked on the frontpage is the story/page. Hope you understand what I said.
bye bye
yaskme
if you know you're not going
if you know you're not going to use promoted content on your frontpage (b/c you're using only views, or whatever reason), go to page.tpl.php and replace
print $content;
with
if(!$is_front) print $content;
Solution : How to remove code for Welcome
Hello friends,
I faced the same problem and solved it by the new way that's why wants to share with you....
1. I made the separate region for front page. because $content hold that welcome message.
3. You can use theme_name.info file for adding new region.
4. I assign my all the content to different blocks and assign those block to the front page region that I made previously.
5. Now check I hope this solution will help you.
regards
Rajat
Another option utilizing base_url() to redirect to your homepage
Here's another option that utilizes some of the above as well. As much as I hate hacking the core, this worked best for me on this specific project.
So in a nutshell:
http://www.example.com/node redirects to whatever your homepage is set as in your Site Information settings (/admin/settings/site-information) rather than show the Welcome to your new Drupal website! default copy.
For Drupal 6 - edit node.module found in the core (modules/node) - and look for line 1756, changing it to $num_rows = TRUE; instead of FALSE. Then after that line, add the two extra lines of code seen below.
Why not just hiding the first-time DIV ??
Using Drupal 6.16
I´ve simply added the following line to the css file of my theme:
#first-time {
display:none;
}
...ye but you are only hiding
...ye but you are only hiding the text...you have not removed the default node message!!
if you disable css (a screenreader or a crawler do this) you can still read the message
Spiders, Bots, Crawlers and Search Engine Results
@johnmullin2003
You're exactly right. If you simply hide the div, spiders, bots, crawlers and whatever else you want to call them will pick it up still and may potentially use it for the description in your search engine result listing. That's definitely something you don't want to see if you want your company name and information to show up in search engine results vs. some default messaging.
any Drupal module/project to
any Drupal module/project to hide the default message without editing the Core code??
thanks all for suggestions
There are dozens of ways
There are dozens of ways without modifying core
Searching the handbook brings up the page pretty quick
It mentions frontpage.module if that's what you want.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
I think the easy way with out affecting the code is
I simply went to
Administer > Site Infomation
Changed "node" to "frontpage"
That was it
I still don't understand
I still don't understand what all the fuss is about. If there is content for your front page, this issue goes away. Why are so many people reluctant to put at least a "Welcome" on their front page?
NancyDru
Time to time I find myself in
Time to time I find myself in need of having the homepage without of any promoted nodes. So I totally understand the reasoning here.
Also I prefer not to use a module if the feature I need is already available in core.
Here is what I have in settings.php on my Pressflow distribution.
By overriding the strings in first-time, I get an empty HTML markup which I can hide easily with CSS:
I hope it helps.
osman
Comprehensive solution to remove Drupal welcome message
Osman,
Thanks, this is a great solution to remove the welcome / first-time message with hacking core in Drupal 6.x. For others convenience, here is s osman's code with minor tweaking for the default Drupal installation:
and here's the css that gets rid of the remaining markup:
This works but google will still show the result...
I tried the css hide approach, but when you look up the site on google you will see
In order to fix it I created a new node (node-16) with a modified version of the slogan of the site, created page-front.tpl.php and added new div around main content called front-page-main-hide and the css code of
Unwelcome
Well, I've read enough topics like this and decided to develop a solution for this very old problem, once and for all, here:
http://drupal.org/project/unwelcome
Everybody is welcome to use! Cheers.
Wonderful!
Works great. Thanks very much for this appmux!
Worked for me
This is what I did to make it work for me:
1. Create a homepage (call it "Homepage" with url-alias "homepage", if you like)
2. In your page.tpl.php file, where you're h1 tag is located, write this:
3. Then, also in your page.tpl.php file, where it says
write in the line right above it this:
4. Then under Configuration > Site Information, where is says "Default front page," write in "homepage" (or whatever you named it)
This works best for me and so far I haven't had any trouble or even SEO any issues with it. It's also very helpful because I don't have to write it over and over again, every time a new version of Drupal come out. Plus, God won't kill a kitten when I hack core.
danielgurtner.com
Worked for me
This is what I did to make it work for me:
1. Create a homepage (call it "Homepage" with url-alias "homepage", if you like)
2. In your page.tpl.php file, where you're h1 tag is located, write this:
3. Then, also in your page.tpl.php file, where it says
write in the line right above it this:
4. Then under Configuration > Site Information, where is says "Default front page," write in "homepage" (or whatever you named it)
This works best for me and so far I haven't had any trouble or even SEO any issues with it. It's also very helpful because I don't have to write it over and over again, every time a new version of Drupal come out. Plus, God won't kill a kitten when I hack core.
danielgurtner.com
=-=
looks like you're using D7
you could use a custom page--front.tpl.php with your hiding of the wecome or render a new region in place of the content region and remove the content variable.
My solution
Inspecting the code of the variable $content in drupal 7 i noticed that the div with class "first-time" is a default message. Do not just hide $content the message remains.
You have to delete the contents of the $page['content'] ['system_main'] ['default_message'] when the div contains the prefix "first-time".
I hope I have been of help!
You can always just use the
You can always just use the following in a hook_preprocess_page(&$variables) function in your theme template.
I dont see any other use for ['default_message'] so I cant see a problem just universally unsetting the whole array. I personally think there should be a simple checkbox to turn this message off in admin, as in most cases its just an annoyance.
hi how i have to write the
hi how i have to write the command exactly? I putted ur code in my template.php but it doesnt work.
i used this:
and putted into my template.php
any easy way?
Six years later I have the same problem to remove the famous message and I try to avoid with a content like a blog entry or and article but as I have a views in front page this solution make appears a pager i don't want. So I try another solution, us I'm using D7 I can not use unwelcome module. I prove Front page module with no good results.
I'm using rubix theme in my website http://www.prevenzion.com I can't belive I can't found any easy solution for that!
Thanks a lot in advance.
Redirect page
Finally I have redirect to another page in configuration/system/ web site information
and seems works well.
=-=
the pager could have been turned off in the view.
Several easy options
Here you have some easy options to do this (without hacking the Drupal's core code):
Removing the "Welcome to your new Drupal website" from the front page
https://drupal.org/node/61233