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 Wishy on
Is there a way to remove the "No front page content has been created yet." text, or even change the text?
Comments
_
create a basic page or article and promote to front.
Besides that.
Besides that.
_
that's the way it's meant to be replaced, but you might be able to also do it with the locale/translation or stringoverrides module but that seems overkill.
Remove "Add new Content" In Drupal 8
create BESIC PAGE set only title and go to Basic site settings "/admin/config/system/site-information" goto "Default front page"
setting an set node id then goto front page remove message "Add new Content" automatically .
Best regards,
Omprakash Mankar
Senior Drupal Developer
Its Amesing way
Thank you so much for this easy way to remove this message :)
Remove "No front page content has been created yet" message
For Drupal 8.5.1 remove "No front page content has been created yet"
Just remove this {{ empty }} from the file below
views-view.html.twig
---
That would change every view and it would remove the message shown when the view shows an empty list. It's rather preferable to change the template file for the specific view.
Thank you!
..
Sometimes, using a block to
Sometimes, using a block to house that basic "welcome" message works better than shoving an article in there. Especially when having multiple regions makes for aligning and tweaking content important in multi-column themes. I too would like to see a simple solution for this.
Site Information's Front Page Configuration
In Home, then Administration, then Configuration, then System, then Site information, you can specify the "Default front page". I specified a node (an alias), and my front page became that content. Leaving this blank dumps the content feed.
From
From http://drupal.org/node/126589 slightly adapted for Drupal 7:
In your theme's page.tpl.php replace
<?php print $content_zone; ?>
with
I had to modify the code
I had to modify the code Argus gave a little for Bartik.
The line I had to find was:
print render($page['content']);
Which became:
Also, you might want to take out the h1 title. It looks like this:
And turns into:
It worked just fine, but in the end I decided not to modify any code. Instead, I used Views to generate a new view of a front page, and then I turned the view into the default front page as rickumali instructed (he was using a node though). If I ever want to promote something to front page, I can now do it without editing code.
"view" worked for me
Like Meepu said, I didn't edit any code.
What i did is:
1. create view
2. go to " configuration>site information"
3. input path of the view I just created as a default front page.
- you can see the PATH on View list ( structure > views)
I am using drupal 7.
" Welcome to YOUR SITE NAME " and " No front page content has been created yet." message are gone !
Thanks!!!
newbie
http://drupal.org/node/1049290#comment-4413150
I like that too but-
How do I create that View?
Views is enabled and clicked Add new and then?
Pafla
Hey Pafla, We have all been
Hey Pafla,
We have all been here. I would spend a couple minutes looking into what/how views functions and the power that is possible. Once you understand how views functions and what can be done, it will then give you more of an understanding on what needs to be done.
WRT to your post, create a page that calls the type of information you are looking for. Where it asks for the URL, insert the path you desire. Then do as step 2 and 3 state.
Best of luck. Also, try to hit up the IRC and/or documentation for topics like this.
Wow!
Wow! 3 paragraphs to give no information at all.
=-=
Maybe mrupsidown should take the effort to read through the topic. It's full of advice, way too full actually.
What I have to edit in this code, Its page.tpl.php
What I have to edit in this code, Its page.tpl.php in Pixture Reloaded theme. Using Drupal 7.7
edited by silverwing - added code tags
This removed all the blocks
This removed all the blocks from the Content region on my homepage... :S
i use a similar approach
instead i use
$is_front
variable, just to avoid function overhead since variable is already available in page.tpl files.Remove message without removing all content
Further to Meepu's code, I wanted to remove just the "No front page content..." message, but keep the blocks I have set to display on the front page in the content region.
My experience was Meepu's code removed all content, to remove just the message I snipped the $page array as follows (Drupal 7 only).
if(!empty($page['content'])) :
print render($page['content']);
endif;
I found this part of the array by adding
var_dump($page);
to explore the array. Or better yet, with the devel module enabled:kpr($page);
Note: I am no D7 expert, so this may not be the best way of doing this.
Dave
This seems to work fine for
This seems to work fine for the zen theme too
Perfect
The unset solution works fine. You can do that in theme_preprocess_page. Thanks.
Simple and Straight Forward
Thank you all for this much needed solution. To combine what Meepu and DavidHadaller have done in D7, I personally have used and like two edits in my theme's 'page.tpl.php' template:
1.) To remove the default message, anywhere within the page is added
<?php if(drupal_is_front_page()) {unset($page['content']['system_main']['default_message']);} ?>
2.) To remove the default page title,
<?php if ($title): ?>
is changed to<?php if ($title && !drupal_is_front_page()): ?>
Alternatively, one could use a template override ('page--front.tpl.php') and specify this output to be omitted.
Thank you dquark3. Adding
Thank you dquark3.
Adding that line in #1 to page.tpl.php worked in the Danland theme.
Making a "fake" blank front page as suggested by others would be easy, but I am not sure how the front page is used throughout Drupal. For instance, will this upset when used in menus and blocks?
Thanks dquark3
Simply as ABC 123 thanks dquark3....did both #1 n 2 and removed both the message and th page title
Best solution
Thank you, that's the solution that works for me.
Thanks dquark3
It worked like charm!!
Editing template.php instead
About Meepu's trick to wipe out the title in the front page, I think it is better to edit template.php as told in this post by adding this to yourthemename_process_page
If you copied your theme from bartik , then page.tpl.php will put the site name in an h1 tag (I think it's better for SEO to have an h1 tag in the page)
And so, it is maybe better to do so for DavidHadaller's trick too, it 's all in one file (template.php) and one function (yourthemename_process_page) by just prepending this to the function code:
Notes:
using either preprocess or process works
@Meepu and MahmoudMostafa, thanks for the snippets.
@MahmoudMostafa I used the
snippet first in a preprocess function and then in a process function. Both worked. I am not sure which is optimal/ how they differ exactly in rendering the page.
So far no errors, but we'll see ... :)
Very simple solution
Go to Structure - Blocks - Main page content - configure - set it to not show on
ISSUE:
The message now appears under where it previously appeared.
Confused
Did you plan on having a blank front page on your site? If not then one of the two standard methods (to be read "designed that way intentionally") should suffice for replacing the default "No front page content has been created yet" message. Lets recap:
That works, except for one
That works, except for one thing. How do i remove the node title?
custom theme template
custom theme template
i just add #first-time
i just add #first-time {display:none;} in the template css or use css injector
#first-time worked, but...
spacereactor's solution worked for me. As a newby and after reading a few of the "it's designed that way" comments, I wonder if I created my theme and/or placed my content in the wrong regions. My home page is designed to have a carousel at the top left with something in the right side column. Using ddblock (and views) I created a carousel and plopped that into the content region. So it shows up on the home page (only) but I still got the "No front page content has been create yet." message.
So... is there a better way to do this so core knows about my content?
It's not that hard
Read this comment again: http://drupal.org/node/1049290#comment-4378398
Make a PAGE for your home page. Set that page as the front page. Now "core knows" about your content. You can even leave the page blank if you really desire. The point being, the default front page is an aggregated page of other content. So the reason "core" doesn't know about your front page content is because you don't have any. So make some.
This Works
Adding this code to my sites css has worked for me
#first-time {display:none;}
Kudos Spacereactor! :D
@gforce301 that works the
@gforce301 that works the same way as Wordpress themes which have slideshows built into them.
in other words, it's the right result in the wrong place.
there should be a way to switch it off in Site information. a simple checkbox like "don't display that message" or even a way to change it.
_________________________
"There is no off position on the genius switch."
- David Letterman
Hey gforce301
Just a quick question for you as I totally get what you are saying and know that this is the correct way of going about this.
My question is, I accidentally deleted my about_us page that had dependent/drop down nodes/links on it. So I've already changed the links to be independent and tried to find the page that it keeps defaulting to so that I can design it but it is no where to be found. It's not under content. So I did step number 2 that you mention above and set it to default front page and it still coming up mysitename.com/about_us/newnodetitle
REALLY frustrating. I've tried some of the other steps as well but the same issue.
Any suggestions would be great!
that's an interesting
that's an interesting approach. I tried it, but it didn't work.
on the "there's a module for that" department, try this: http://drupal.org/project/front :)
_________________________
"There is no off position on the genius switch."
- David Letterman
page--front.tpl.php
recently, I got challenged with this case.
I finally solved this with a new template.php.
Duplicate page.tpl.php with a new name, page--front.tpl.php. (usually in active themes)
remove any
Perhaps, that's what you need :)
So easy that you probably overlooked it...
The Main Content node is a block. If you go to Structure>> Blocks you can see it. However, unlike when you assign regions for the other blocks, it won't have a -none- field in the dropdown. If you click on "configure" in the right hand column though, you will find the Region Settings for the theme and you can select -none- in that dropdown.
Block error
I noticed that.
Tried it, and when I try to save Block:
With Danland theme.
You're probably going to need to designate a view as a homepage
What you should do then is to:
1) Create a view that is a page (Structure >> Views +Add new view. Click +Add and select Page from the menu that show up)
2) Have it display the kinds of content you want on your homepage (use the filter criteria)
3) Designate it as the home page (under PAGE SETTINGS set Path: to front-page)
Now that view will be your front page, and you won't have to deal with the message.
I ended up using the solution
I ended up using the solution by dquark3 above.
I use
<front>
throughout my site so do not want to set up a fake front page.I did it in administration. I
I did it in administration. I have configured block Main content visibility: display on each page except
<front>
//edit> I am sorry, this doesn't work
Check for front page using if statment
Like a couple of posts mentioned before, use the drupal_is_front_page method. I left my statement empty. If you don't like leaving statements empty, then just have it return a null variable.
if (drupal_is_front_page()) {} else{print render($page['content']);}
Install this module
Install this module http://drupal.org/project/empty_page and create a Empty call page menu link, And use the link as home page in "admin->settings->site information"
Drupal Theme generator
Delete "No front page content has been created yet" and title
Just add this code to the page.tpl.php or page--front.tpl.php on Drupal 7.
find
<?php print render($page['content']); ?>
and replace with below code.
And i believe you surely get all blocks or contents you posted on page.
and to remove page title on page like
Welcome to "website name"
find this code on page.tpl.php or page--front.tpl.php
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
and you can remove this code or else just make a comment
over
<?php //print $title; ?>
put this code in template.php
Works perfect for me, thanks
Works perfect for me, thanks !
worked great for me. Edited
worked great for me. Edited it slightly:
Also, fair warning to noobs (I speak as one): Make sure to rename 'template' to the name of your theme. Also. make sure you aren't calling "template_preprocess_page" earlier in the document (gave me a 5 minute headache.) :-)
Done!
This worked fine for me. Thanks! :)
Thanks , worked fine too.
Thanks , worked fine too.
Thank you!
With Drupal 7 and Danland theme, these instructions worked perfectly. Thanks!
edit: just to be clear, I followed marafee1243's post (October 27, 2011) to the letter.
Great, Works like a charm.
Thank you very much!!! I have been struggling with this and now it works perfectly in my AT-Commerce theme.
Getting rid of the mandatory "title" or "welcome to" makes the front page so much more elegant.
THE MOST SIMPLE WAY
How To Hide / By Pass the "Welcome to XXX" "No front page content has been created yet" in your drupal front page
This message / content appeared when you have nothing publish in front page.
DO NOT EDIT / MODIFY / DELETE ANY DRUPAL CODE MANUALLY
Solution:
For Drupal 7 :
1) Install View.
2) Go to (path)#overlay=admin/structure/views. (Structure > Views)
3) Make sure the VIEW NAME template "Front page" is enabled.
4) Go to (path)#overlay=admin/config/system/site-information (Configuration > (System) > Site information)
5) Key in "frontpage" to Default front page setting.
6) Save
You can promote / publish / demote your post,content,page in your front page ANYTIME
I am sure u can get the satisfied result.
@ahhao perfect...thanx.
@ahhao perfect...thanx.
Bingo! -thanks // darren
Bingo! -thanks
// darren
BEST ANSWER How to Hide "Welcome to" "No Front Page Content"
I wish this was posted on every thread about this, and stickied at the top.
Excellent!
Wow, thanks! I had to delete this and redo it twice before it took (followed same steps each time). Maybe I needed to clear out my cache before it took?!
Either way, thanks for the very simple instructions. I agree, this should be sticky on the top of EVERY ONE of the dozens of messages about this topic.
The Most Awesome-ist method!
Drupal 7.22
I would just add that you need to include additional steps between Step 3 and Step 4:
Even if you don't do the above edits, you need to save the View at least once, or else Step 5 will fail.
Not so sure about those filter criteria
What if a client actually hàs unpublished content, which is quite common?
A more water proof filter would be Content: Type = is none of (all content types checked).
This can easily be done within seconds with a brand new view. Make a View Page, apply the filter criteria with Content: Type and give it a path which you will use in your website information settings.
Or check this clever approach.
Done and done.
nothings work
No matter what i do, i promote view, block, contents or panel to the front page or changed default page in site information. But when I visit domain.com/node it shows that message.
no idea how to disable that node without id? Please help.
Thread summary
Using Views was already mentioned by mikib and by marcnischan and, although a very simple one, is by far not the "ONE AND ONLY DON'T CHANGE ANY CODE' solution you suggest to the problem most novice Drupal users face. There is nothing wrong with changing code in the theme layer, just don't hack Drupal core.
Nobody wants an empty frontpage. Drupal assumes you create content, once you do so the message disappears automatically. By default Drupal displays all nodes that receive the "promote to frontpage" setting. This leaves you with a blog-style list of teasers of all published nodes. Often this is not the required outcome for a frontpage. This thread suggests some alternatives:
You can create a page, say a basic page content type, call it "My Default Homepage" then go to ../admin/config/system/site-information and set that page as Default frontpage. This is what gforce301 suggests. Most users then want to remove the page-title which leaves them with yet another problem.
You can use one of the many modules that provide a solution: Front, Empty Page, Empty Front Page and I'm sure there are a few others if you search for it.
You can use Views to create a query listing content, display it on a page, give that page a path, and set that path to be the default frontpage. Basically this is what the comment I reply to suggests.
And then there are the theme layer coding solutions. dquark3's solution changing a few lines in your theme's page.tpl.php, MahmoudMostafa's solution to use a preprocess function added in template.php, and vande's solution to use an other page altogether. You then still have to create content for the homepage. :)
All in all this underlines one of the difficulties for novice Drupal users, there are numerous solutions to a problem, and you have to know what Drupal presumes. The original question has been well answered but we keep repeating ourselves because people don't read what others have written.
noted
Thank you Argus, you are nice man~~
i rather name it to "welcome" than formal name (frontpage,front,default,etc... ). ^^
BTW, sometime i am lost my way while searching solution in deeper forest.
Complicated and "TOO" much information, some are duplicated one...
Thank you Argus for that
Thank you Argus for that brilliant summary, I have created a wiki at my group Students of Drupal and copied your post into it. This is one of the topics that everyone will have to learn early in their drupal career and you've done an excellent job of summarizing this long-winded discussion, we need more posters like you. Also thanks to everyone else who contributed the various solutions to this problem.
Thank you dquark3
D7-adaptive theme-corolla subtheme
Edited page.tpl.php
Pasted this in the first line:
Changed this:
For this:
I just wanted to thank you for sharing your knowledge.
Empty Front page
As said above, use http://drupal.org/project/empty_page
No coding install the module, enable it, job done!
It's work
it's work fine i paste in place - page.tpl.php
/sites/all/themes/yourTHEMME/templates
that
Hide no front page content created yet
Put it in a block you do not need, css hide the block
remove it on the template.php file
As i see on this tutorial http://youtu.be/zLBXY2Ig4go (minute 18 about) you can add this to the template.php
function pruebas_preprocess__page (&$vars,$hook) {
unset($vars['page']['content']['system_main']['default_message']);
}
Hope it helps
The way I removed mine was
The way I removed mine was simply edit modules/node/node.module
around line 2622, I just changed that line from the "no front page message" to ''
$default_message = '
' . t('') . '
';
_
just a follow-up for any newbies that may stumble across this post-- modifying core is never a 'correct' answer. And simple is in the eye of the beholder-- it may seem simple, but when at some point those 'simple' core changes get wiped out by a routine upgrade and you either don't remember or can't figure out what happened then it's anything but 'simple', lol. Typical example of pennywise and pound foolish.
Remove this as default behaviour
While it's currently a default behaviour of a Drupal installation, I think it should be taken into consideration to allow the admin to switch this off (D8 maybe).
One solution could be: drop this in a block that is switched on by default (in the block admin page), thus the admin can remove this block if deemed necessary.
I do believe this may be an issue (if you can call it that) for many developers.
Big NO NO
Just to reiterate and beat a dead-horse and circle back: This is a huge no no.
While this may be the way to go about getting a task done in other systems, editing core in Drupal is against all Drupal standards. I think it is safe to assume that people who are looking at this post are fairly new to the Drupal world and looking at different means of content population on the site. Use one of the many numerous answers above, follow some tutorials, search for hours, but do NOT edit core unless there is no other Drupal means of getting the job done.
Delete No front page content has been created yet. Easier
You find the file
node.module
inside
your-project-name\modules\node\
now open the file and inside, find the text 'No front page content has been created yet.'
you should find this line
$default_message = '
' . t('No front page content has been created yet.') . '
';
now delete the text
No front page content has been created yet.
so you have this line when you are finished
$default_message = '
' . t('') . '
';
(remember to leave the simbols around the text
''
inside t(''))
save the file and refresh your browser....magic :D have a nice day
note: i recommend you to have an edit program to open code files, like notepad++. Its totally free and works perfect for drupal.
_
uh no... this is not recommended. Please don't recommend poor practice in the forums. You only end up doing more harm than good to newbies.
What I did (I don't Know if itt's the best practice though)
1. Firstly, I created a new content (Basic Page) with the body content empty and title: home.
2. Then, I went to Configuration > Site Information > Default front page end placed my new page's alias (http://mysite/en/home)
3. I created the Views I needed as blocks and placed them in certain regions configurating them to be visible only in frontpage () (more info on theis in Views Slideshow tutorials)
4. I added some code in pge.tpl.php for the page Title (home) not to be printed ( I use the Bartik theme):
(explaining code: I replaced the
if ($title):
for theif ($title && !drupal_is_front_page()):
as said by Meepu on February 10, 2011 at 5:18pm)I hope this to be helpful for some, as previous post where helpful to me :)
Thanx!
=-=
@sonapie: If you want to edit the page.tpl.php of Bartik (which is a core theme), copy the Bartik folder to your sites/all/themes folder and edit that file over there. If you don't, all your edits will be cleared with the next core update.
Personally I think there are better practices mentionned in this thread, but if it floats your boat...
use yr CSS file
here is the way to hide the message : no front page content .....
in your css file add this code :
#first-time {
display: none;
}
nd to hide to title in your front page use this :
in your template.php file, just add this :
function artheme_preprocess_page(&$variables) {
if (drupal_is_front_page()) { $variables['title']=""; }
}
have a nice day.
Thanks you
Worked with me.
I think Drupal.org needs a
I think Drupal.org needs a "Like" button!
The most simple answer!
http://drupal.org/project/stringoverrides
Original: No front page content has been created yet.
Replacement:
Done! Message is gone!
using template.php
here it is using php in the template.php
function youthemename_preprocess_page(&$variables, $hook) {
if (isset($variables['is_front'])) {
unset($variables['page']['content']['content']['content']['system_main']['default_message']);
}
}
or
function yourthemenam_preprocess_page(&$variables, $hook) {
if (isset($variables['is_front'])) {
($variables['page']['content']['content']['content']['system_main']['default_message']="";
}
}
Add this to your page
Add this to your page preprocess function in your theme:
if (isset($variables['is_front'])) {
unset($variables['page']['content']['system_main']['default_message']);
}
subscribing
subscribing
There are 2 Modules to solve
There are 2 Modules to solve that:
https://drupal.org/project/empty_page
https://drupal.org/project/empty_front_page
I use successful empty_page.
– Greetings from Frankonia –
"A decision is mostly a good decision if it leads to more opportunities.”
Heinz von Foerster (Kybernetiker)
My tip
Look at https://drupal.org/comment/7198432#comment-7198432
Wusel
I did it by creating a page
I did it by creating a page view with a filter that would never produce any content (I made a condition that the NID of the node to show in the view should be 99999999999) and set its path as /home, and then set the default front page in "site information" to /home.
Normally I wouldn't need to do this because I'd make a legitimate custom view for the home page, or just use a basic page, but in this case the site didn't actually require either. Which is perhaps odd.
nid = "x"
That's quite clever. It's even more waterproof if you set the nid-value to be "x", which is never going to happen since alphabetic characters don't occur as node ID's.
Just put these lines to your page.tpl.php
Just add these lines to your page.tpl.php, just below the commended area.
well it's not mine solution, but I have found it somewhere and other post, and now can't find where it is from.
If you do not have page.tpl.php in your subtheme, you have to find it in the core theme, and then copy it to the same location as core theme, to your subtheme.
In AT it's /templates/page.tpl.php
it means that in your Adaptive theme subtheme you have to create folder named "templates" and then copy there page.tpl.php and then delete the part of code mentioned above.
It's important that you do not make any changes to the Core theme!
Just in case some one want to
Just in case some one want to remove the 'welcome message' as well, this is what i did
this is the theme_process_page function, replace the 'content_top' by your region's name , normally it should be 'content'. clear the cache then the message should be gone.
Make it easy
You only have to add some normal content after a fresh install of drupal7, which is visible at the homepage.
Then this is visible at the homepage of your new drupal-website.
Wusel
https://www.drupal.org
https://www.drupal.org/project/empty_front_page
this works though.....
Simple!
Just add this code to your source file or through CSS injector:
.front #main-content {
display: none;
}
drupal 8
In Drupal 8 there's a View that generates this content. You can find it at admin/structure/views/view/frontpage. Also, the twig file for that view is located at drupalroot/core/views/templates/views-views.html.twig, copy it to your theme so you can modify it.
The easiest way would be to
The easiest way would be to create an empty basic page and go to the site settings and set the new node as frontpage. Works for both Drupal 7 and Drupal 8.
May not be best practices
(Drupal 7) In local.css of your theme/css:
#first-time, .front h1#page-title{display:none;}
Hides all of that text, Welcome message and link to create content.
It's sort of an irresponsible way to handle items you want to "get rid of", but it is fairly predictable, easy, and easy to reverse. It is also easy for me to remember if/when I want to reverse it.
Module Empty Front Page works fine
Hi guys,
I would like to concur with previous comments, suggesting the module Empty Front Page as a potential solution for this ticket.
D7: The module is very clean, simple, lightweight and contains a single hook:
hook_menu_alter
. It overrides the path'node'
's page callback'page callback'
which returns an empty array.Just enable the module (flush the cache if necessary) and the
No front page content...
should have disappeared.D8: Project' page has some information about the D8 module, but I didn't have any chance to test it yet.
Would be glad to hear some feedback from anybody who's tested/worked with the D8 version.
Thanks very much to everyone for your testing, reporting, feedback and involvement in the Drupal community.
Cheers!
Empty Front Page
I've been using: https://www.drupal.org/project/empty_front_page I found it from watching this video: https://www.youtube.com/watch?v=bRC1U-0dvRs&index=8&list=PLzW5qZqWSqtWHt...
In D8
That's a view, so what I did was to remove it with CSS (don't know if that's a bad practice).
.view-frontpage {
display: none;
}
Plain and simple.
in Drupal 8 / structure /
in Drupal 8 / structure / views /Frontpage / in the Page Settings / "No Results Behaviour" Section: Click to edit each item and click 'remove' (NOTE: do this in the "No Results Behaviour" section only)
drupal 9
use front page css selector
.path-frontpage .pr-main {
display: none;
}
drupal 9 use path-frontpage selector
.path-frontpage .pr-main {
display: none;
}
Thanks for your guide.
Thanks for your guide.
Drupal 9 - You can do easily from Views
Drupal 9 provide default view for front page. Go to - admin/structure/views/view/frontpage
and remove this message from section "No results behavior"
Page not found - The requested page could not be found.
That won't work. You will get this error:
Drupal 10: Remove Welcome! No front page content has been ...
Thanks @auxiliaryjoel, this still works in Drupal 10 and removes the "Welcome! No front page content has been created yet" message:
/admin/structure/views/view/frontpage
Global: Unfiltered text Global: Unfiltered text
Content: Empty Node Frontpage behavior Content
Global: Title override Global: Title override