By real1st on
I created a custom module (which represents graphical navigation) and want to make it appear on front page in place of nodes. I implemented hook_menu() and make it to be shown on /nav url. But I need it to be called when front page is loaded. And I need to make nodes to not appear in front page. I created news module (node module), and it should react on /news url, but not front page.
What should I do to do that?
Comments
I need logical, not hackish way of doing this thing.
I don't want to use some hackish way touching drupal core. I need some logical way of doing this thing.
I tried several ways of doing this:
1. Make my front page navigation module act like block and make it appear only on front page in content bar (through block configuration in administration interface). It worked good except one thing: standard drupal welcome "Welcome to your new Drupal website!" is displayed anyway, since there is no node content set to be promoted to front page. I can remove it touching core, but this is hackish way.
2. Create node of page type, make it php code format and call the function in my module to output it, and promote it to front page. This is not logical, because node type is used to publish some content with link "read more" and it goes to rss feed. Node type content is designed to publish multiple content (multiple pages, news, books etc). But I need just one place for my front page navigation module to appear.
Any suggestions? Maybe there is some contributed module for this type of problem?
Solution is found.
I've found the solution to this problem by myself and want to share it. It could be useful for someone.
I've just added a menu item with 'path' = 'node' in hook_menu(), as shown in the following code:
Front page module
Hi Real - have you checked out the 'front page' module (http://drupal.org/project/front). It offers a lot of flexibility when you want to control the front page of your site.
I am but a learner ... putting content on front page
I'm sure there will be some blinding moment of realization when I finally understand I've not been thinking about Drupal as a CMS system clearly, and that there is some obvious benefit to why it is challenging to make a piece of content and have it be the front page of my web site. I'm just playing around with a local installation, and changed the logo and title, but still have this "Welcome to your new Drupal site!"
Waiting for the benefits to learning all this to start flowing in...
=-=
you have to create content for it to be put on/become the front page.
create a blog node or a story node. your default front page will become, what is affectionatly known as a river of news. like the front page or drupal.org
once a node is promoted to the front page, the welcome message is removed.
if you want a specific node to be the front page and don't want the river of news style, create a page type content, then goto adminsiter -> site information and set default front page to the node you created.