Does anyone else wish there was a way to turn off the "welcome to your new drupal website" message?
Many sites will include Mission + Blocks but no promoted nodes on front page. In these cases the "welcome etc" message will appear unless measures are taken.
Of course there is a css solution:
#first-time {
display: none;
}
However, this is rickety, in that you must not include it in style.css until _after_ the site has been set-up, first user registered, etc. A workflow hassle.
And of course one can set a regular page to be the home page, dodging the issue, but creating more extra work. (A "mission" div on front page offers unique and quick css hooks, whereas a regular node masquerading as a mission might need all sorts of this-n-that to avoid making every node look like the mission.)
I've been using a simple two-part hack to core that gives me a configuration option. By default, the message is turned on. A simple checkbox switches it off. (Now that's my kind of work!) It's fairly bulletproof in that the "welcome etc" setting can't be changed until someone has admin access - ie, until user/1 has been created. I tucked the setting option under admin/settings/site-maintenance in my hack, as it seems both an appropriate and an uncluttered home.
Screenshot attached. Patches to follow.
Apologies in advance if this feature has been requested, and refused, in the past (I suspect it has, though found no evidence...) And I know there's a sound preference for keeping admin configuration options to a minimum.
But a guy can try...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | welcome_msg_node.patch | 751 bytes | chromeyellow |
| #1 | welcome_msg_system.patch | 732 bytes | chromeyellow |
| drupal_welcome_message_config.png | 13.14 KB | chromeyellow |
Comments
Comment #1
chromeyellow commentedPatch 1 (for system.module) adds a radiobox control with option to turn "welcome to drupal" message off. Sets a variable turn_off_welcome in the variables table. By default this is '0' - i.e. message is 'on'.
To do: probably should 'auto-disable' this admin option if admin (i.e. user/1) doesn't exist. Just in case ... er... maybe an existing db is being (partially) rolled into a new site or some such scenario.
Comment #2
chromeyellow commentedPatch 2 (to node.module) goes into node_page_default function.
If_and_only_if no nodes are promoted to front page, a quick check of the turn_off_welcome variable is made. If this returns TRUE then $output is set as null for this function, and nothing is displayed (except your front page blocks, mission statement, etc etc). If this returns false, then the usual 'welcome to your new drupal website' message displays.
Comment #3
Steven commentedYou can already change the front page to something other than 'node' to do this.
Comment #4
greg_y commentedRe #3, that is not at all clear when you first install or upgrade. I've been using Drupal since 4.6 and have had to comment out the "Welcome to your new Drupal website" language from node module with every release.
Our use case, which I would guess is not uncommon, is that we don't promote anything to the front page, but use views and custom fields to automatically select home page items. So using "promoted to front page" as the test for whether a site is new does not work for us, and I suspect others.
If the "Welcome" language code is to stay, I'd suggest the test use node count instead: a new site has node count = 0, an upgraded site has count >0.