By Alex Latchford on
Hey guys,
Is there a method of setting a homepage made purely from blocks.. I want get put a few bits of static text, (mission statement etc..), perhaps a intro video on the homepage..
I have changed the "default front page" within Administer->Site Information, but it then gives you a page with a heading which isn't exactly what I want.. (I want to be able to style the blocks).. I'd like to be able to just add static blocks into the "content" section of the theme and then change them periodically..
Anyway I have searched the modules database and googled a bit, but to no avail.. Anyone have any suggestions?
Thanks in advance, Alex Latchford. :)
Comments
.
i am not a themer... but I do know that views has a "front page view" all set up and is used by adding "frontpage" the site information section and enabling the view.
http://drupal.org/project/views
.
just a note or food for consideration.. I just went over to read the intro for views. And after using views, the text on that page doesn't mean a whole lot till you experience the power of views.. u will be amazed-- a real nice piece of work, how would I live with out it.. don't have answer 4 that...
Custom home page path using a very simple module
If you don't want to use a node as a basis for the page (e.g. one way is to make a Section node type, and use its nodes as placeholders for various pages like this), then you could also register your own empty "page" in Drupal and set blocks to appear on it in the standard way. Custom pages such as this exist in Drupal by means of them having an entry in the menu system. This is how the modules you install add their own custom pages, and you can do the same as well. If you've never made a really basic module, it's actually very very easy (I can do it and I'm still pretty new to PHP). I wrote about how here http://drupal.org/node/416986
Here's an example:
If you don't want "anything" but a blank page, you could put
return '';in customsite_home() instead. In the above,['home']is the path you are setting.After you add this, you should rebuild the menu cache for it to be used. Do this with the cache clearing button on the Performance page, or using Admin Menu module (top left icon) or with the block provided with Devel module.
To set this as the front page, go to Administer > Site configuration > Site information and set the "Default front page" option to
home. On your Blocks admin page you can then set the blocks to appear on<front>and have them appear only on this page.removing title
In addition to this, if you also want to remove the title, you can add a 'title callback' which points to a function that returns an empty string. Like this:
.
I should have brought this up, there is another project that is also a very cool bit of fancy code work.. this one is more than cool, it rocks...
http://drupal.org/project/panels
not stable
in version 6 yet
Panels still not have stable
Panels still not have stable version with drupal 6.x so as per best drupal standards and practices don't use them on production sites.
You can customize your site home page according to your requirements. It depends on you whether you wish to show nodes or just blocks on home page. There is a great article for this:
http://tips.webdesign10.com/drupal/how-make-a-custom-front-page-drupal-3...
OR
You can follow some of drupal advise from http://drupal.org/theme-guide/6
It will help you to manage site home page as you requested.
Hey guys! Thanks for the
Hey guys!
Thanks for the excellent response, I took a look at the views first and to be brutally honest I did not understand the concept.. So I removed it..
Then I created my own module, which is what I am now using.. (In the meantime)
I also took a look at the Panels project and as lalit.cmswebsiteservices said it is not stable enough for me to use yet, but I have bookmarked it for the future definitely as the project I am working on is designed to be handed over so fully customisable panel type structure would be very useful!
lalit.cmswebsiteservices, the link you provided is dead, if you could find the article again I wouldn't mind reading it..
Thanks again, Alex
Hi Alex - Looks like the link
Hi Alex -
Looks like the link that got cut off is this page.
It's incomplete and been a while since I worked on it, but my collection of info on various ways of making front pages in Drupal might be handy for you. In particular you might like this analysis I did of drupalsn.com's home page. There's also some snippets on this page for embedding regions, blocks, and views directly in templates where they usually don't go.
Hope this helps.
page-front.tpl.php
What I've done is make a copy of page.tpl.php and name it page-front.tpl.php. This particular template file is automagically used for the front-page only. In that file you'll remove (I believe) three lines of code that displays the content. What this allows you to do is create any block and add it to the page in the block configuration.
Very helpful
I just wanted to comment that it worked like a charm. I added a new file deleted the divs regarding content and breadcrums for the front page template and all gone... just blocks.