I ran into a very legitimate reason to be able to disable MPC block & use another in it's place on certain pages, but the content persists anyway (even w/ the MPC block off).

* Technically* the block is obeying settings since the block region is gone, but the content that would be inside it is dumped on the page lower down without the block's html wrappers.

I can only imagine this topic has been touched on before (but I couldn't find a queue item) so I won't make this post longer than necessary.

Just for some point of reference, In Omega theme, Found the persisting content in:

<?php

function xxx_preprocess_page(&$vars) {
  //This variable w/in preproc page had the persisting 'Main page content' block.  \/
  $vars['page']['content']['content']['content']['system_main']
}

?>

Comments

jwjoshuawalker’s picture

I also tested with other themes before posting. It is repeatable with Bartik as well.

jwjoshuawalker’s picture

Issue tags: +D7UX usability

Tagging with usability since editing that block leads you to believe that you can hide it like any other, but it's content remains.

Google searching for things along the lines of 'hiding Main page content block' returns results of users being confused by the behavior, and then their instructions given are to either CSS display: none, write a module, or a template preprocess function. Not ideal.

My use case for example:
On the site, Main menu & it's 2nd level of links (9 links top level, and 5-6 each sub level) are all taxonomy terms and built w/ Taxonomy Menu. So each of these 45 pages are just pathed to the term page. This is the intention for all but 3 of the pages, so everything to this point feels like it was done very clean & efficiently. These other 3 pages need to show something else, so seeing that Drupal's main content section is now placed in a block w/ D7, my first thought was "Ok, I can just hide that one on these 3 pages, and replace w/ a different block for what is needed on these pages". The outcome is very different though, and confusing if you aren't a developer.

Another note: I've only tested w/ node & taxonomy term pages.

BarisW’s picture

How can we reproduce this?

jwjoshuawalker’s picture

@BarisW

The fastest way is going to seem silly. Create a node & turn off "Main page content" block for it's path.

On a brand new site, Standard install profile, the HTML for the area goes from being:

<div id="block-system-main" class="block block-system">
  <div class="content">
    <div id="node-1" class="node node-page node-full clearfix" about="/test" typeof="foaf:Document">

To just:

<div id="node-1" class="node node-page node-full clearfix" about="/test" typeof="foaf:Document">

The rest of the node's markup stays the same afterwards.

jwjoshuawalker’s picture

Does this make sense?

dalehgeist’s picture

Yes, it makes sense. I am using generic nodes to set up my nav, but I am populating those nodes exclusively with blocks (views, etc.) - I don't want any content to show. Yes, I can simply not enter any content, but that feels like a workaround. I feel like my approach is Drupalesque, yet the Drupal core UI (in this case, block visibility settings) is not yielding the expected result.

dalehgeist’s picture

Issue summary: View changes

Reaffirm that block is obeying but content persists

swentel’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)