Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because the title for a block can be which displays as nothing, you can have a block with no title or content that doesn't get the filler text which can be frustrating to edit. The patch below just alters the if statement to include if($block['title'] == '') as well as empty.
Comment | File | Size | Author |
---|---|---|---|
#7 | boxes-beta7-empty-text-none-1440178-7.patch | 1.04 KB | alphageekboy |
#4 | none-tag-empty-text-1440178-2.patch | 1 KB | alphageekboy |
#1 | none-tag-empty-text-1440178-1.patch | 667 bytes | wbobeirne |
Comments
Comment #1
wbobeirne CreditAttribution: wbobeirne commentedComment #2
wbobeirne CreditAttribution: wbobeirne commentedComment #3
tirdadc CreditAttribution: tirdadc commentedTested it out and committed it. Thanks!
Comment #4
alphageekboy CreditAttribution: alphageekboy commentedThe original patch worked great for displaying the block when logged in with appropriate rights. However, this prevented the box from completely hiding if it was empty when you didn't have edit rights for the box. Thus, the box would still render with empty content. Ideally, we want to the box to not render when you do not have edit rights.
The patch attached adds a return if the box is empty and you do not have box edit rights. This prevents the box from being rendered if "Hide if empty" is checked and you do not have box edit rights.
Comment #5
tirdadc CreditAttribution: tirdadc commentedReformatted some stuff including comments and committed.
Comment #7
alphageekboy CreditAttribution: alphageekboy commentedAttaching a patch against the beta7 version of boxes for the above. The original patch was patched against the dev version.