Closed (fixed)
Project:
MySite
Version:
5.x-2.15
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2007 at 05:13 UTC
Updated:
24 Nov 2007 at 02:19 UTC
The way block.module works is, if any block is empty it does not display. This is a handy way to make dynamic blocks that display depending on the context. In every case I've come across, an empty block is more useful not being displayed. That may be just my opinion, but here's a patch to address the issue:
(see attached)
It could probably be accomplished more eloquently, but I am not yet superfamiliar with the module and I didn't have a lot of time. Hope this helps! :)
| Comment | File | Size | Author |
|---|---|---|---|
| mysite.patch | 1.69 KB | ms2011 |
Comments
Comment #1
agentrickardNope, this is the right fix for the droplets, though I might use an !empty instead of a !strlen (personal preference).
But -- thinking and typing -- if I have added a block to my collection and it _disappears_, then I might think that something is broken.
We should probably just pass an 'empty content' message -- isn't that the behavior now?
Comment #2
agentrickardNeed to patch against the latest release.
Comment #3
ms2011 commentedI would not display it. You get the same type of behavior with views when it's not working--it just doesn't appear. I would say that is normal, and although possibly more frustrating to the new Drupal developer, commonplace and more useful in the long-run.
Comment #4
agentrickardIt isn't the developer that I'm concerned about. It is the end user.
Consider:
- A user is allowed X elements on their page (default is 10).
- The user adds the "Dynamic Block" element and 6 others.
- "Dynamic Block" returns empty.
- 6 elements are shown on user's page.
- User asks "Where the heck is 'Dynamic Block' that I added to my page?"
- User thinks the site is broken.
Because of this case, I think returning an empty message is more appropriate.
I'm also a little confused. Are you saying that Views droplets disappear if they return empty?
Comment #5
ms2011 commentedOk, I see your point. Now I would agree with you that it should display an empty content message. Is it possible that the droplet could customize that? Like with views, if you create a block you can also provide Empty Text.
And, I was saying that If you use views to create a block and provide no empty text, and there are no nodes matched and no header or footer text, it will not appear just like any other empty block.
Comment #6
agentrickardSeems like a valid feature request. Frankly, I hadn't considered cases where the Block or View would be empty.
Can you open a new issue against HEAD describing what you want?
Comment #7
ms2011 commentedWell, I thought about it some more, and in every case I can think of that I would be using it, I have control over the returned value using PHP. Therefore, I could detect whether the block is going to be empty and provide an empty message from within the block.
So, nevermind it for now.