Problem/Motivation

In certain circumstances, the Main Content Block appears appears in a selection list, as an optional selection. It should not be optional.

Proposed resolution

Prevent the Main Content Block from being deselected. The main Content Block's selectability is being modified to prevent it from not being selected, or deselected, since it is required for proper rendering.

Remaining Tasks

The issue summary seems to have strayed from the original report. "Normally, when you configure a block, and you say "Show block on All Pages except those listed", and then you list a page, the block is hidden on that page. If you are configuring the Content block, this is not true." vs. "In certain circumstances, the Main Content Block appears in a selection list, as an optional selection. It should not be optional." Should this be split into two different issues? Also see comment #65 as a possible work around.

User interface changes

@todo

API changes

@todo

Original report by jensimmons

Normally, when you configure a block, and you say "Show block on All Pages except those listed", and then you list a page, the block is hidden on that page.

If you are configuring the Content block, this is not true.

I set the content block on my site to list on every page except "node/9". I also did this for all the blocks in the sidebar.
http://img.skitch.com/20100117-mbc747ueerwi95gybkqjea25ty.jpg

The sidebar blocks are hidden. The content block displays.
http://img.skitch.com/20100117-bk5ppxy5ai2stj1ya5pahayy2d.jpg

It should instead look like this:
http://img.skitch.com/20100117-xgwbjunijy7hfxy6d8abj5xb99.jpg

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ask4prasath’s picture

create a separate tpl.php file for the desired page and remove those divisions from that tpl file
cheers

ask4prasath@gmail.com

jensimmons’s picture

A) Those screenshots are from Bartik, a theme for core, so making a custom tpl is not an option. This is not a design for a specific site, it's the design of a tool for anyone to use without hacking the theme. (You can see the Bartik demo at http://bartik.milkweedmediadesign.com/node/9 )

B) The content block should hide like all the other blocks. There is no indication that the behavior of this one block is different from the others. The interface and the help text on the content block setting page all indicate this block will hide. The fact is doesn't is a bug. It's a new "drupal wtf?"

Let's fix it.

aaron’s picture

Confirmed behavior. This happens even with Garland:

To reproduce:

- create a node (say node/1), with some text in the body.
- go to admin/structure/block/manage/system/main/configure
- configure 'Show block on specific pages' to not display on node/1
- go to node/1 -- you should not have the main content (but you do).

aaron’s picture

moving that block to another region also has no effect. perhaps the block isn't what it appears to be from the description?

aaron’s picture

looking through the API, it appears this may be by design. the 'main' content block in http://api.drupal.org/api/function/system_block_view/7 returns the entire page content as http://api.drupal.org/api/function/drupal_set_page_content/7

http://api.drupal.org/api/function/drupal_render_page/7 will display it even if it's been set to false.

aaron’s picture

ah, the content does move to the sidebar if you tell it, UNLESS you have it set to not display, in which case it's displayed back in the original location. appears that you cannot control the visibility of this block -- it's required. thus, we should disable that section for this block configuration page.

aaron’s picture

Status: Active » Needs review
FileSize
1.6 KB

This patch removes the main content block visibility settings to avoid confusion.

aaron’s picture

Note that this doesn't stop an administrator from being able to "disable" the block (to no avail). I considered also removing the 'Disabled' option from the region drop-downs, but realized the same effect could be had by dragging it to the disabled region on the block list page.

The whole thing seems like a hack to me -- I guess it's useful to be able to label the main content and move it to another region. But it's obviously confusing to the administrator when it doesn't otherwise act like a block.

aaron’s picture

The alternative would be to have the main content block honor its visibility and disabled region settings. But that could too easily leave the entire site broken with no way to fix except in the database...

seutje’s picture

it actually doesn't show the main content block, but it does show it's content

with the block enabled on this particular page (garland btw) -> http://gyazo.com/c63b12dc919407654af84dc68d0a14bf.png
with the block disabled on this particular page -> http://gyazo.com/5d1941589acd5e23a56fb74dea0284bc.png

note the absence of the region and block wrappers

not saying this is how it's suppose to act, just trying to shed some light on what's actually happening

aaron’s picture

that's actually the way it's "supposed to act". you never want to disable content from the page, because that can effectively shut down your drupal site for good.

i suppose one might want to be able to turn off the block wrapper, and this would be the way to do that. seems like that's better handled with css to me.

maybe this issue should be marked 'won't fix'?

Jacine’s picture

Issue tags: +Bartik

Tagging this so we can keep track as it relates to Bartik.

dmitrig01’s picture

Assigned: Unassigned » dmitrig01
jensimmons’s picture

You can't disable the content block? Then what's the point of making content a block? I think it would be great to be able to disable the content block on certain pages. Especially the front page. Sure those of us who know how to erase the printing of $content from the page-front.tpl.php don't need this, but what about everyone else?

Perhaps we leave a safety so it's not possible to disable it on all pages. Only a certain list of them.

For sure, changing the help text would help. Right now, it's pretty misleading.

dmitrig01’s picture

In common.inc, starting on line 4928, there are a few lines of code that basically say "has anyone printed the main content? if not, print it." The idea behind the code that keeps it there is that if you disable the block module, you'll be able to enable another page managing module (read: panels).

However, we can set that variable to TRUE regardless of anything in block.module. That's the approach this patch takes.

willmoy’s picture

Issue tags: -Bartik

Moving to bartik project. Keeping at needs review until there's a dev release / CVS HEAD to review against.

willmoy’s picture

Project: Drupal core » Bartik
Version: 7.x-dev »
Component: block.module » Code

Actually changed project this time, sorry.

aaron’s picture

Project: Bartik » Drupal core
Version: » 7.x-dev
Component: Code » block.module
Issue tags: +Bartik

Ummm, no, I believe this is larger than Bartik.

jensimmons’s picture

Yeah — this isn't about Bartik, this is about core. I designed Bartik to take serious advantage of the fact content is now a block, assuming I could hide the content block like any other block.... and then I discovered you can't do that.

I think you should be able to do so. If that seems like a dangerous power to give people, then let's put warning messages along the way and ask for confirmation.

Or, if there is some reason why we don't want to allow people to hide the content block completely, then let's allow them to hide in on a few specific pages (disabling the options to hide always or hide everywhere except
) and put clear help text in place to explain what's going on.

OR if the consensus disagrees with me completely, and wants to ban the hiding content in any way, then at the minimum there must be help text explaining what's up, and that you can't hide the content block like other blocks.

I know I'm repeating myself, but there seem to be confusion about about what I'm talking about. If you still don't understand, go install D7, and imagine you are building a site. Then think to your hypothetical self, "hey I'd like to have one of those cool front pages with a while bunch of different blocks that only show up there — and oh! I'll hide the block that's the long list of blog posts on the home page... that will be cool. I know how to hide that block..... uh... why is it still there? What's wrong? Why isn't this working? I don't get Drupal. I suck!" <<-- we don't want that.

RobLoach’s picture

This applies to every theme, ever. I'd like to hide the content block.

bleen’s picture

subscribe

bleen’s picture

#15 works fine and solves the issue.

This comment in common.inc:4612 seems to indicate that this is probably the right way to handle the problem.

  else {
    // Indicate that the main content has been requested. We assume that
    // the module requesting the content will be adding it to the page.
    // A module can indicate that it does not handle the content by setting
    // the static variable back to FALSE after calling this function.
    $main_content_display = TRUE;
    return $content_block;
  }

However, it's worth asking whether this code (from common.inc:4772 - below) should simply be removed. I cannot think of a single case where the content region would be empty unless (a) the content region is hidden as in the example in the original post or (b) a module purposefully decides to manipulate the content region and therefore no assumptions should be made about whether or not to force the content.

  // If no module has taken care of the main content, add it to the page now.
  // This allows the site to still be usable even if no modules that
  // control page regions (for example, the Block module) are enabled.
  if (!$main_content_display) {
    $page['content']['system_main'] = drupal_set_page_content();
  }

Thoughts?

dmitrig01’s picture

Well, if you disable the block module, then without that code you wouldn't be able to enable any module (like block or panels) to show the main content

bleen’s picture

Status: Needs review » Reviewed & tested by the community

Until right now I never realized that the block module *could* be disabled. Now that I know, I'd say your argument is compelling for keeping that code. :)

That said ... I'm happy with the patch in #15 so I'm marking RTBC. If someone else wants to come along and review then mark accordingly

BettyJJ’s picture

What about doing a simple check in the code:
if it's on admin page, force display the content block;
if not, obey the user's setting.

So, the problem mentioned in #23 won't be a problem, and it keeps the flexibility of blocks.

bleen’s picture

Something like this:

  // On admin pages, if no module has taken care of the main content, 
  // add it to the page now. This allows the site to still be usable even 
  // if no modules that control page regions (for example, the Block
  // module) are enabled.
  if (!$main_content_display && arg(0) == "admin") {
    $page['content']['system_main'] = drupal_set_page_content();
  }

This seems like it might be a fragile solution...but then I think that every time I use the arg() function in an if()... thoughts?

realityloop’s picture

dmitrig01’s picture

Every time you use arg() god kills a kitten. arg() is not the solution. Ok, well maybe in Drupal >(8|9) we need it we still really sholudn't be using it. Disabling a module shouldn't make your site break, but you can't see anything except the admin section with that solution.

I still like my solution

webchick’s picture

Status: Reviewed & tested by the community » Needs work

It'd be good to get this documented in the code here, since it's not immediately obvious what's going on, and there's a lot in this issue that's not captured by just reading the code.

webchick’s picture

Issue tags: +Needs tests

Hm. And come to think of it, we should add some tests, too, so we don't accidentally break this in the future.

dmitrig01’s picture

Good idea. will do in a bit

dmitrig01’s picture

dmitrig01’s picture

Status: Needs work » Needs review

This patch should work better.

Status: Needs review » Needs work

The last submitted patch, remove_default_content_687686.patch, failed testing.

dmitrig01’s picture

oops, git patch

dmitrig01’s picture

Status: Needs work » Needs review

bah

markabur’s picture

Status: Needs review » Needs work

At a minimum, s/manging/managing/

But the documentation doesn't make sense to me anyway since I'm not familiar with $system_main_content_added and the docs right now don't really tell me why it's being set to TRUE here. Is this some kind of flag that tells system module not to populate $content?

sun’s picture

Ugly issue.

  1. When Block module is disabled and no other page region handling module is acting, Drupal needs to force the output of the main content block.
  2. When Block module is enabled, it is likely responsible for outputting the main content block, but not necessarily.
  3. When Block module is enabled, but does not render the main content block (via visibility settings or other means), the main content block may still be rendered by another page region handling module. block_page_build() is executed anyway, and regardless of whether the main content block was actually output, the current patch would tell core that it has been output.
  4. Clearly, the cause of this problem is that we do not invoke hook_block_view() for invisible blocks. Or in other words: Even if the page region handling module is properly acting, we cannot tell whether it attempted to output the main content, because in the case of Block module, the visibility settings prevent the invocation of the right callbacks to indicate that we attempted to render, but purposively did not want to render the main content. Or in other words: We are technically not able to differentiate between a failure and an intended omission.
  5. We cannot change the invocation of block callbacks for D7. So we need to solve this with a hack. The currently proposed one makes me feel a bit nervous though, since it presumes that Block module, whenever enabled, is responsible for the main content block - since block_page_build() is invoked no matter what.

Hopefully this serves as summary to move on here. No conclusion contained, so please share your ideas and considerations.

jensimmons’s picture

Assigned: dmitrig01 » Unassigned

Bump.

At the minimum, in my opinion, we need some help text to let people know what's going on.

scottrouse’s picture

Bumping this...

Having the main content as a block seems like a very elegant UI solution to, say, being able to hide the "river of news" content from the front page. That is a question I hear over and over from those new to Drupal: "How do I get all these posts off the front page?"

With a little bit of playing around with D7 this week, I've found that I've had trouble removing the front page content using a template override (which, incidentally, I finally figured out as being page--front.tpl.php rather than page-front.tpl.php). If I remove the <?php print render($page['content']); ?> line, I lose that block region on the front page...not the intended behavior. From the Blocks admin UI, it seems one should be able to define the Main page content block to not show on the <front> page only and call another (custom) block into that Content region.

What's the status on this one?

sun’s picture

Priority: Normal » Major
Issue tags: +API change

After re-reading my summary, the existing and recent patch is all we can do for D7.

Steps to fix this issue:

1) Revise and completely revamp the inline code comments, removing all emotions and "wordy" stuff.

2) Add a test to confirm that this patch fixes the problem.

3) Test manually, mark RTBC, and inform maintainers of Panels/Context and alike modules about this patch.

scottrouse’s picture

The patch in #35 didn't seem to work against 7.0-beta3 or HEAD, but I could be doing something wrong.

bleen’s picture

Status: Needs work » Needs review
FileSize
1.03 KB

this is an untested reroll of #35 ...

pfrenssen’s picture

This definitely needs some help text to explain the possible consequences of disabling the main content. But where should this help text be shown? There are several places where the visibility of the block can be changed:

  1. In the main block admin page, by drag & drop or using the dropdown menu
  2. in admin/structure/block/manage/system/main/configure under 'region settings'
  3. in admin/structure/block/manage/system/main/configure under 'visibility settings'

A confirmation page would perhaps be the best solution.

Damien Tournoud’s picture

Priority: Major » Normal

Actually, if the main content itself is a block, the main title, the tags and messages are not. This makes the usefulness of the moving and/or hiding this block very very limited. Downgrading to a normal bug.

stephthegeek’s picture

I was trying to do this again today, assuming it had been fixed since the early Bartik issues, and ran into this issue.

Damien: the situation described in #40 seems to be the most common use case (hiding the main content on a front/landing page, not a full node), in which case the proposed solution would be completely applicable so people have a core way of making a 'blocky' front page. Having the block hiding mysteriously not work is very confusing.

sebsebseb123’s picture

Hi All,

- I recreated the issue on my local.
- Tested the patch in #43.
- Works!
- Added a simpletest
- Rolled it in with the patch from #43...(which is a re-roll of #35.)

This is my first patch submit, so if someone could let me know if I'm doing this properly according to best practices... I feel like I missed a step ;)

...also, I do agree that perhaps there should be a warning/confirmation page. Maybe it would appear only when you're about to remove the Content block on all pages? Anywho...

Thanks,

pixelgrrl’s picture

I agree with all the comments here and wonder why the page content is set as a block with the typical show/hide options when they are really just fake options!

The solution I went with to remove the dynamic content from being pumped into the homepage was this:

1) Create a "page--front.tpl.php" template (duplicate the existing "page.tpl.php" and make sure they are both uploaded together)

2) Remove all the php calls inside the "content" div around line 105 leaving just this: print render($page['content']);

3) Change the "content" region to "content_home" or something similar: print render($page['content_home']);

4) Save file, open .info file and add the new "content_home" region below the definition for the "content" one. Upload all files mentioned.

5) Refresh the site and admin panel and you should now have two content regions ready to accept blocks: "Content" and "Content Home". Leave the offending page content block in the normal content one so it populates all subpages as expected, and drag all your homepage blocks to the new "Content Home" region.

Voila. Kludgy, especially with the direction of the logic they were going with in D7, but it works.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev

Still a valid issue in Drupal 7.2.

caravinci’s picture

and 7.4. and btw, it's not only bartik... I'm using a customized Zen theme and it happens too.
subscribing

ckng’s picture

subscribing, as running into this issue again.

caravinci’s picture

I "solved" it by creating a separate template for the front... but it still doesn't change the fact that hiding the content on the home via blocks is not working and it should... or at least should display some sort of message stating it wont.

andrenoronha’s picture

subscribe

ziodave’s picture

Issue tags: +zen

For Zen users, to prevent the main content block to show I made the following, in file zen/zen-internals/template.theme-registry.inc, added these lines:

  $main_content_display = &drupal_static('system_main_content_added', FALSE);
  $main_content_display = TRUE;

around lines 13-14, just after

 function _zen_theme(&$existing, $type, $theme, $path) {

This is not a clean solution, but Zen could implement a configuration property here and act accordingly.

Maybe other themes can be patched the same way.

migrad’s picture

Hi! This is my solution for hidden the main content block on the home:

1) You must create a new type content, for example 'home'.
2) On the configuration of the main content block, in 'Types of contents' select 'home' and save.
3) In the node block, file node.module line 2557, the following code appears:

drupal_set_title(t('Welcome to @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), PASS_THROUGH);

    $default_message = '<p>' . t('No front page content has been created yet.') . '</p>';

    $default_links = array();
    if (_node_add_access()) {
      $default_links[] = l(t('Add new content'), 'node/add');
    }
    if (!empty($default_links)) {
      $default_message .= theme('item_list', array('items' => $default_links));
    }

    $build['default_message'] = array(
      '#markup' => $default_message,
      '#prefix' => '<div id="first-time">',
      '#suffix' => '</div>',
    );

Well, comment it, and add:

    drupal_set_title('');
    $build['default_message'] = array(
      '#markup' => '',
      '#prefix' => '',
      '#suffix' => '',
    );

The main content block already not appear on the home page, but this is not perfect I know... but work. :)

Bye.

xjm’s picture

Status: Needs review » Needs work

Looks like there are a few suggestions for fixing this. Let's get a current patch implementing one of them.

this_is_it’s picture

I've tested that solution #43 and #55 do not work in drupal 7.9, any ideas?

this_is_it’s picture

I found a theme-related solution, as in marinelli theme.
add following css pieces to drupa.css file:

.front #block-system-main {
  display:none;
}

clear cache, you will see 'main content page' disappears.

seutje’s picture

this issue needs a "might contain some of the worst ideas ever" tag

bdu’s picture

It looks like that all that want this would be using it to customize the front page. Why no simply allow just suppression on the front page? And error on anything else?

All work arounds have it computed, but suppress it in one way or another. In theory it is possible to safe some cycles by not computing it at all, as the system can know it will not be needed.

clicsoluciones’s picture

Status: Needs work » Needs review
jensimmons’s picture

@bdu — This would be helpful for any kind of landing page, not just the front page. Many sites with lots of content have complex landing pages for everything — taxonomy terms, subsections of the site... I could see similar things done for even little sites.

I think having something like this behave differently on the page marked "front page" from all other pages would only add an even more complicated WTF.

kamescg’s picture

Title: Prevent hiding the Content Block on particular pages » Hiding the Content Block on particular pages doesn't work.
Assigned: disasm » Unassigned
Issue tags: +Needs tests, +Bartik

Bad Information

pfrenssen’s picture

Guys, hiding stuff with CSS is an ugly workaround. Don't do that.

alexanderpas’s picture

Title: Prevent hiding the Content Block on particular pages » Hiding the Content Block on particular pages doesn't work.
Status: Needs work » Needs review
Issue tags: -Needs reroll +Needs tests, +Bartik

I suggest a totally different approach: Disable the block visibility settings for the content area.

This matches the observed behaviour.

99% of the time the content area SHOULD NOT be hidden. (on all /admin and */edit pages for example it MUST NOT be hidden)

in that 1% where you think it should be hidden, such as landing pages, you SHOULD put the information you want to show into the content.

I personally think this is the simplest approach for the block module.

If you want anything more fancy, you can for example create a content type that only contains a title, or use a page views to push thing into the content area.

webchick’s picture

Status: Needs review » Needs work

Ah, nice! I was looking for this patch. :) No longer seems to apply, though.

ryan.gibson’s picture

Status: Needs work » Needs review
FileSize
2.88 KB

Okay, so here's a reroll of the patch for 8.x.

Status: Needs review » Needs work

The last submitted patch, content-block-visibility_687686_67.patch, failed testing.

disasm’s picture

+++ b/core/modules/block/block.module
@@ -314,6 +314,15 @@ function block_page_build(&$page) {
+  // modules, but since this is a page-manging module, we're in charge of the

should be page-managing

+++ b/core/modules/block/lib/Drupal/block/Tests/ContentBlockTest.php
@@ -0,0 +1,69 @@
+    parent::setUp();

Need to pass an array of modules to setUp that need enabled. Block needs to be one of them.

disasm’s picture

Assigned: Unassigned » disasm
disasm’s picture

Status: Needs work » Needs review
FileSize
2.25 KB
2.88 KB

attached is a patch that does what I suggested above, yet still fails. There's something wrong with my syntax in the settings array for body, because even if I simplify it to drupalCreateNode(...) followed by drupalGet('node/1'), the body doesn't show up in the get request. I'm marking this needs review to invoke testbot so others can see the error.

Status: Needs review » Needs work

The last submitted patch, drupal-6154380-hide_content_block-71.patch, failed testing.

chx’s picture

If you want to hide the main contents block why can't you use a small contrib which slaps an #access FALSE on it? #65 sounds the right idea to me -- do not allow the main content to be hidden.

chx’s picture

Also... I doubt this can happen in D7 and hopefully in D8 Blocks Everywhere will kill this issue before we kill each other debating over it :)

tim.plunkett’s picture

Title: Hiding the Content Block on particular pages doesn't work. » Prevent hiding the Content Block on particular pages
Issue tags: -Bartik +Needs issue summary update

I updated the title according to how I understand this issue is headed.
Can someone update the issue summary?

tim.plunkett’s picture

Issue summary: View changes

added issue summary template

tim.plunkett’s picture

switched input format

tracycarroll’s picture

Changed issue summary

tracycarroll’s picture

Issue summary: View changes

Updated issue summary

tracycarroll’s picture

Issue summary: View changes

Fixed typo

tracycarroll’s picture

Issue summary: View changes

Edit

tracycarroll’s picture

Issue summary: View changes

Edit

Jeff Burnz’s picture

Issue summary: View changes

Remove img tags for remote images, link to the image instead, since we are not allowed remote images

ajeverson’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
825 bytes

This is a test for the approach in #65 which is removing the visibility settings on the main content block.

Status: Needs review » Needs work

The last submitted patch, 687686-77.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Edited Issue Summary

disasm’s picture

Attached is a patch that hides visibility setting is module is system and delta is main.

The only problem is that the node module has a hook_form_alter that adds content type to the visibility pane. However; it doesn't have a block object in the function, so putting a conditional if statement there is more difficult.

It might be possible to investigate the block based on the form array, but I want to hear further advisement before I modify that module as well.

disasm’s picture

Status: Needs work » Needs review
AlmogBaku’s picture

Version: 8.x-dev » 7.16
Priority: Normal » Major

Happend with the lastest released version:
The system "push" this block into the content region, even if the block is set to exclude the path or set to none region.
Happend with child theme of zen.

tim.plunkett’s picture

Version: 7.16 » 8.x-dev
Priority: Major » Normal

Please see the backport policy.

nightlife2008’s picture

FileSize
1.8 KB

Instead of patching this behaviour, we should more likely circumvent it.

I've created a small module which contains a context reaction, to remove the system content block. This way we don't have to patch core, and we can re-use the functiunality with context conditions.

See attachment for module, until I can release this as a real module on d.o.

tstoeckler’s picture

Title: Hiding the Content Block on particular pages doesn't work. » Prevent hiding the Content Block on particular pages
Assigned: Unassigned » disasm
Status: Needs review » Needs work
Issue tags: -Needs tests, -Bartik +Needs reroll

This doesn't apply anymore.

pwieck’s picture

Assigned: disasm » pwieck

Working on re-roll to current head

Status: Needs review » Needs work

The last submitted patch, drupal-remove_visibility_settings-687686-86.patch, failed testing.

pwieck’s picture

Kicking back to coders. Conflict in reroll. The head has a newer function block_admin_demo()

/**
 * Page callback: Attaches CSS for the block region demo.
 *
 * @see block_menu()
 */
function block_admin_demo($theme = NULL) {
<<<<<<< HEAD
  return array(
    '#attached' => array(
      'css' => array(drupal_get_path('module', 'block') . '/css/block.admin.css'),
    ),
  );
=======
  drupal_add_css(drupal_get_path('module', 'block') . '/block.admin.css');
  return '';
}

/**
 * Page callback: Shows the block administration page.
 *
 * @param $theme
 *   The theme to display the administration page for. If not provided, defaults
rgoodine’s picture

Assigned: Unassigned » rgoodine

Working on the reroll.

rgoodine’s picture

Assigned: rgoodine » Unassigned

Tried a reroll, but there was a large conflict. #88 only shows the first part of the conflict.

alexanderpas’s picture

Title: Hiding the Content Block on particular pages doesn't work. » Prevent hiding the Content Block on particular pages
Status: Needs review » Needs work
Issue tags: -Needs tests, -Bartik +Needs reroll

I'm actually now thinking this should be closed as "works as designed"

If you have multiple modules that are able to show the main content, such as Panels and the Block module, as long as for example Panels is showing the main content, you can hide the block without a problem. (or you can show the content twice on the page)

Only if no module handles the main content for example when Panels doesn't handle the main content AND you have the Block module disabled (or the block hidden) Drupal will print the main content as a fail-safe to prevent breakage of your site.

I've seen several other issues clutter this issue, such as the front page node listing (front page can be edited in setting, there's a published to front page setting, I agree /node should be able to be disabled but that is another issue.) that do not belong in this issue.

Really, 99% of the time the content area SHOULD NOT be hidden. (on all /admin and */edit pages for example it MUST NOT be hidden)

in that 1% where you think it should be hidden, such as landing pages, you SHOULD put the information you want to show into the content.

If you want anything more fancy, you can for example create a content type that only contains a title (perhaps together with the Rabbit Hole module), or use a page views to push thing into the content area.

alexanderpas’s picture

alansaviolobo’s picture

This patch seems to be created for D7 whereas the issue is tagged 8.x.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Sonal.Sangale’s picture

Tried to reroll the patch. There were two files deleted and status is upto date. Hence no need to reroll the patch.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 7.x-dev
Issue tags: +Needs issue summary update

This is a difficult issue to review. The Issue Summary is a bit of a muddle. The problem refers to selection and option lists but then there isn't any reference to that in the comments. The remaining tasks says the the Issue summary has diverged from the original and then asks if this should be split into two issue but, again, didn't find any comments discussing that point. And It would really help to have complete Steps to Reproduce.

In #38 sun gives a nice summary of the situation. And then in#41 says that the patch in #35 (rerolled in #43) in the best that can be done for D7, with some further suggestions. Then a patch in #47 that was tested and includes a test.

Then, there is #65 which says that this works as designed and offers ways to not show the block. This is supported in #73 and reiterated in #91.

Then I took a pause and looked for related issues and found #2546590: Main content block shows up on page, even if hidden. That is a duplicate, working to solve the same problem. However that one is D8+ specific while this is D7. Therefor, changing this to D7.