Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm new to Drupal 7 and I'm looking to replace the frontpage's default main content block with an equivalent block generated from Views (gaining more control over the block in doing so).

I have successfully generated the new frontpage block in Views and added it to the content section however now the homepage displays both the original and the new views block.

Attempting to remove the main content block by configuring it to not display on <front> does not work and for now the only workaround I have found is the following CSS:

.front #block-system-main {

I'd prefer a less hack-like solution. Can anyone suggest one?

share|improve this question

3 Answers 3

up vote 19 down vote accepted

Sorry, but that's not the way to do it.

Instead of creating a block display in Views, create a page display. Choose a path for your views page, for instance "home", and save the view. Next you go to /admin/config/system/site-information and change the value for 'Default front page' (it probably says "node" now) to the path you chose for your view ("home").

When you follow this approach, the main content on your front page will be the view.

share|improve this answer
Ah I see.I have tried your suggestion it works perfectly and seems very obvious now. Thanks marc. –  irishbuzz Mar 21 '11 at 21:45
You're welcome, glad I could help. –  marcvangend Mar 21 '11 at 22:23
Thanks, definitely the cleanest solution on here! Others were talking about mucking around in the core code or setting up stylesheets. I knew there had to be an easier way. –  Organiccat Aug 11 '12 at 15:11

First of all you have to remove the default home content, here is the way to do that:

if (drupal_is_front_page()) { $variables['title']=""; unset($variables['page']['content']['system_main']['default_message']); }

Remove homepage default content

Then create the block view that you want.. then go to blocks.. show this block view in "content" region .. and restrict this content to "only the following pages" and write

That's it

share|improve this answer

Although not a common approach, you can embed a view as main content block on frontpage. Views has the flexibility to do it either way in a wink. I suspect you misconfigured the block removal step you were trying or ... merely had to clear the cache to obtain the same result.

To be fair on the accepted answer, that approach is the usual way of doing it. End result is identical.

share|improve this answer

protected by kiamlaluno Jan 2 '13 at 13:05

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.