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 {
display:none;
}


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

• I have exactly the same issue. – JW. Oct 15 '15 at 19:27
• I don't have enough reputation to answer this question. But I wanted 2 'view lists as blocks' and no other content so here is an alternative solution: drupal.org/node/2089911#comment-7868495 (then show the list or lists as blocks) – JW. Oct 15 '15 at 20:21

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").

• 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
• @MarioAwad technically, yes. That's how the Drupal front page setting works. However, if all modules correctly build URL's and links with the url() and l() functions, Drupal will take care of it and link to www.example.com whenever www.example.com/path/to/view is given. If you like, the Global Redirect module will redirect to the front page in the case that someone would explicitly request the full path. – marcvangend Mar 25 '15 at 10:49
• @marcvangend thanks for the extra clarifications and the pointer towards Global Redirect which solves the double path issue. Cheers. – Mario Awad Mar 25 '15 at 12:53

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

<?php
function MYTHEME_OR_MODULE_preprocess_page(&$variables) { if ($variables['is_front']) {
$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 <front>

That's it

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.

• I think it is a bug in Drupal because I, too, tried that 'block removal step' and it simply did not work. – JW. Oct 15 '15 at 19:29

## protected by kiamlaluno♦Jan 2 '13 at 13:05

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).