By michelle on
I have a detailed mission statement which is fine for my front page. I may have news items on the front page from time to time, so I don't want to set the front page to something else. But if there is nothing promoted to the front page, I don't want that "Welcome..." coming up. I just want to leave it empty except for the mission if there are no nodes promoted.
I've searched the site and all I found was someone telling the person to add content, which doesn't help me. :)
Any ideas?
Thanks,
Michelle
Comments
change default page
In administer > settings, you can change the default page. Create a Drupal page and then set the default page to this.
__
My Drupal websites: Personal home page | Nabla Design: specialized Drupal application hosting
Yes, I know that...
But, as I said, I don't want to change the page to something else. I want to leave it as "node". I just want to get rid of the message.
Thanks,
Michelle
hack node module
The content was there in the node module. If u want to get rid of it simply find in the node module and alter it.
Sunny
www.gleez.com
Ah, there it is...
It never occured to me that something like that would be hardcoded into a core file. I thought I must be missing a setting somewhere. Well, I really don't like changing files that get overwritten with new releases but, looking at that code, I guess that's the only way to do it. :(
Thanks,
Michelle
another way
use flexi node without content and promote to front page.
u can use flexinode-1.tpl.php and remove the print calls of title and links in the file.
so that ur homepgae will same as usual and no need of hacking the code. it wont display the welcome message.
Sunny
www.gleez.com
That sounds good
I'll give that a try. I just deleted that part of the node module and ended up crashing my site. LOL. Good thing I make backups. :)
I'll try the flexinode way. Good idea.
Thanks,
Michelle
Welcome
Always welcome.
As an after thought i got this idea after reading the form again.
Need any help feel free to contact me.
Sunny
www.gleez.com
Theming the new node
I created a new content type called "placeholder". This is #3 of the fliexinodes, so I created a new file "flexinode-3.tpl.php" and put it in my theme directory. In this, I put:
I created a node of type "placeholder" and promoted it to the front page. But it seems to be ignoring this new tpl file. I've been looking through the theming flexinode pages and can't see what I'm missing. Any ideas?
Thanks,
Michelle
Nevermind, I figured it out.
I just copied the file name from your post and changed the number. I was looking through the handbook on themeing flexinode again trying to figure it out and finally realized the filename is wrong. Whoops. :)
"node-flexinode-3.tpl.php" works :)
Thanks again,
Michelle
Solution - summary
To sum up, for anyone who searches on this issue in the future:
1) Install flexinode if you haven't already.
2) Create a new content type with no fields on it. I called mine "placeholder"
3) Create a new node of type "placeholder" and just give it a title. Promote this new node to the front page.
4) Create a file called "node-flexinode-X.tpl.php" where X is 1 if this is your first flexinode content type. If it's not, go to the content types list and hover over the "edit content type" link to see which number it is.
5) In this new file, put:
Voila! Your node should be invisible for that theme. Don't forget to copy the file to all themes if you have more than one. Note: this only works with PHPTemplate themes.
Hope that helps someone else. Thanks to sangamreddi for the help!
Michelle
Sorry for the file name
In hurry i forgot to keep the node. Sorry...
Thank You. Have a nice site
Sunny
www.gleez.com
Not a problem
I wouldn't have thought of using Flexinode if it wasn't for you, so figuring out the filename was nothing compared to coming up with that. :)
Thanks,
Michelle
Thank you
It's very detailed and useful description. Thank you
FrontPage Modul
Well... you could also try to install the frontpage module.
http://drupal.org/project/front
Then in the setting menu, redirect your default page to front_page, anyways, just try install and read the documentation there first.
Good luck.
Cheers,
Zulfikar Dharmawan
Wow, old post...
Interesting idea. I wonder what front_page shows if you use "print node_page_default()" and there are no nodes promoted?
It's a moot point for me since I've drastically changed the site in the months since this was posted, but it's an interesting thought. :)
Michelle
it shows you the new-install Welcome message
I tried it.
Front_page doesn't work on q=node. if there is no promoted content you get the install welcome.
The real question is why is q=node effectively the home page anyway? I'm sure many sites don't want the default homepage to be a list of recently promoted content.
I tried changing the default page to node/41, which works fine except when takenm to that page, there are two breadcrumbs for "home' and "content" and clicking either of those gets us back to the install message again.
extraordinary that such a thing should be embedded in a module and possible to return to after install. most annoying.
I think I'll have to abandon front_page module, create a flexinode type of front_page, create one instance, embed PHP code in it to give it the smarts to display different info to registered and non-registered users, promote it to front page, and pray that none of my content administrators accidentally promote something else or de-promote this one (like that's never going to happen in the lifetime of the site!)
anyone got other ideas?
node is default because that
node is default because that is they way Drupal started out. A community site to post content. Front_page should allow for anonymous page content just fine.
You can also custom build a theme template with logic to detect UID0 (anonymous) and logged in user. There are some misc php snippets floating around and the is_front is documented in the phptemplate guide int he theme developers book.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Thanks.in the end I kept
Thanks.
in the end I kept front_page, hacked the node module to replace the welcome text with a "no content to show" message, and removed breadcrumbs (as they don't work quite right with front-page).
Unfortunately I'm using bluemarine which is a xtemplate theme which limits my hacking options.
I'll go check out the snippets again. I couldn't get is-front to work in any of my primitive hacking attempts
thanks again
Rob
is_front is a phptemplate
is_front is a phptemplate theme engine based trick
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
I suspected as much
anyone know the equivalent code in xtemplate, if any?
...
I don't, but you could always use the PHPTemplate version of BlueMarine:
http://drupal.org/project/bluemarine
Michelle
xtemplate front page
thanks, I'll look at it.
I found the code
if ( $whatever == variable_get("site_frontpage", "node") )cheers
Rob