See the three screenshots. When you first add new content via the IPE — or move content from one region to another — a blank div appears to be inserted. This creates a false spacing until you reload the page.

Not a major blocker, but ideally after you hit "save" your page would be back to what it really looks like.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Hm. Pictures 4 and 5 seem to have invalid links, so I can only see 6.

joshk’s picture

FileSize
224.66 KB
300.53 KB
221.71 KB

Whoops. Here they are again.

patrickroma’s picture

Actually I have a similar problem... After every panel region a <div>&nbsp;</div> is atuomatically inserted. Here is the code from firebug:

<div class="panel-region-separator"></div>
<div>&nbsp;</div>

I am searching everywhere to find the source of this div. Any ideas?
Using Panels 3.7

Thanx in advance

PetarB’s picture

I've got this issue too. Looks horrible. Any thoughts?

thowas’s picture

Edit /sites/all/modules/panels/panels_ipe/js/panels_ipe.js

And remove " " from :

$('div.panels-ipe-sort-container', this).append('

');

Summit’s picture

Subscribing, after hours of searching found this! Thanks, why is the empty line added?
greetings, Martijn

Wallack’s picture

Disable the panels inplace editor module.

This only appears if the user has the rights to use panel in-place editor but as many of you won't never use this module, disable it directly so it won't appear.

The blank space appears to be able to drag and drop blocks into regions when using inplace editor.

Regards!

bryancasler’s picture

FileSize
90.6 KB

Same thing is happening in the 7.x dev. Like #7 said, just disable IPE to make it go away.

bryancasler’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

Forgot to update the version in my last post.

Summit’s picture

Why do you update the version please? It is still valid information for Drupal 6?
Whats the policy for changing version numbers?
greetings, Martijn

merlinofchaos’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

Ah hm. Yeah it's valid in both versions. I don't have a specific policy for versions, but let's leave this where it was.

This hasn't been fixed because I don't know how to fix it, btw. More or less, it's an artifact of the drag and drop system.

Summit’s picture

Hi Earl,

It is only there for login users with IPE permission. And if you know it, it's not a problem. Can't the blank line not get a meaning, something like "this line is there when you check IPE in Panels"?
greetings,
Martijn

tmsimont’s picture

same problem here.. #5 doesn't really work out.. :(

tmsimont’s picture

Version: 6.x-3.x-dev » 6.x-3.9

i see this problem in 3.9

ccbearyeh’s picture

Thanks @Wallack, It's works for me. Just uninstall panels inplace editor module.

I'm using Panels 7.x-3.0-alpha3 and Drupal 7.10

ordermind’s picture

Here's the solution I came up with. It's sort of a quick fix but it works and should give you an idea of how to solve it in a better way. As I avoid hacking core and contrib this code goes in a separate js file. The basic idea is to hide the div dynamically whenever you're not actually using the ipe.

(function($){
	var _oldShow = $.fn.show;
    $.fn.show = function(speed, oldCallback) {
        return $(this).each(function() {
                var
                        obj         = $(this),
                        newCallback = function() {
                                if ($.isFunction(oldCallback)) {
                                        oldCallback.apply(obj);
                                }

                                obj.trigger('afterShow');
                        };

                // you can trigger a before show if you want
                obj.trigger('beforeShow');

                // now use the old function to show the element passing the new callback
                _oldShow.apply(obj, [speed, newCallback]);
        });
    }
})(jQuery);

(function($) {
	$(document).ready(function() {
		$('.panels-ipe-sort-container > div').each(function() {
			if($(this).html()=='&nbsp;') {
				$(this).addClass('hide-when-no-ipe');
				$(this).hide();
			}
		});
		$('.panels-ipe-off').click(function() {
			$('.hide-when-no-ipe').show();
		});
		$('.panels-ipe-off').bind("beforeShow", function() {
            $('.hide-when-no-ipe').hide();
        });
	});
})(jQuery);
Nigel Cunningham’s picture

I'm seeing this too, after enabling the IPE for my front page. I like the idea of adding and removing the nbsp as needed. Is that a possibility, Earl?

Regards,

Nigel

Nigel Cunningham’s picture

Hmm. How about modifying the line that adds the nbsp to:

$('div.panels-ipe-sort-container', this).append('<div class="panels-ipe-on" style="display:none">&nbsp;</div>');

So that it's hidden when the IPE is not in use?

sdboyer’s picture

Assigned: Unassigned » sdboyer
Status: Active » Patch (to be ported)

There are two problems being described in this issue. Everyone who's describing an empty div being generated who isn't using IPE (#3 and everyone responding to it), that's a separate issue; the original issue pertains to a case . A puzzling one, actually, as if you haven't explicitly chosen to use IPE to render a given Panel, there's no reason it would add anything to the page. And you do have to opt-in to using IPE.

...that having been said, the fix here was actually really simple. That empty div didn't need to be injected at all, there just needed to be a min-height set on the sortable container in order for it to still be a usable drop target. Much better solution, I've commushed the fix to 7. My local 6 instance is causing me some problems, though, so I'm marking this for backport.

patrickroma’s picture

How to fix this for D6?

merlinofchaos’s picture

The patch needs to be backported to D6. Unfortunately there is currently no one who has significant time to invest in D6 maintenance. Anyone still using D6 who would like to do the work to help update the patch would be most welcome.

patrickroma’s picture

If I could see the exact patch for D7 I would try...

merlinofchaos’s picture

imatsu@drupal.org.es’s picture

Español:

Yo pude remover este div desde el archivo /sites/all/modules/panels/plugins/styles/default.inc

en la línea 23:

$output .= implode('<div class="panel-separator"></div>', $vars['panes']);
lo convertí en
$output .= implode('', $vars['panes']);

English:

In the file /sites/all/modules/panels/plugins/styles/default.inc remove

in line 23.

$output .= implode('<div class="panel-separator"></div>', $vars['panes']);
to
$output .= implode('', $vars['panes']);

FAAREIA’s picture

Title: A blank div w/non-breaking-space is being inserted when new content is added via IPE » Erase output of <div class="panel-separator"></div>
Version: 6.x-3.9 » 7.x-3.x-dev
Category: bug » feature
Priority: Normal » Minor
Status: Patch (to be ported) » Active

Hi people, i'm always deleting <div class="panel-separator"></div> in every project i start. I like to have a clean layout and no extra css. It would be great if we do not include this unwanted/unnecessary tag anymore.

Thanks for your time.

merlinofchaos’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Category: feature » bug
Status: Active » Patch (to be ported)

Stakcreativa:

As pere #19:

There are two problems being described in this issue. Everyone who's describing an empty div being generated who isn't using IPE (#3 and everyone responding to it), that's a separate issue; the original issue pertains to a case . A puzzling one, actually, as if you haven't explicitly chosen to use IPE to render a given Panel, there's no reason it would add anything to the page. And you do have to opt-in to using IPE.

Returning to previous status. This issue is about a needed backport of a bugfix from Drupal 7 to Drupal 6.

Incidentally, if you want to get rid of the panel separator, just theme the region style to make it go away. Or just add a display: none for it in your CSS to ensure it doesn't display anything. In general, there's no need to get rid of it, and it's useful if you want to actually display something for the separator, such as a background gif.

merlinofchaos’s picture

Title: Erase output of <div class="panel-separator"></div> » A blank div w/non-breaking-space is being inserted when new content is added via IPE
merlinofchaos’s picture

BTW the theme function you want to override to get rid of it completely and forever is theme_panels_default_style_render_region

FAAREIA’s picture

Thanks merlinofchaos, i really ever saw it was themeable. (-_-)
Sorry for my previous post.

  • Commit 3d62c6e on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by sdboyer:
    Issue #848704: Fix blank div being inserted by IPE into sortable...
DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.3 KB

I manually recreated sdboyer's changes.

DamienMcKenna’s picture

Assigned: sdboyer » Unassigned
japerry’s picture

Status: Needs review » Fixed

I had to do some re-formatting before committing, but it fixes the problem for me. Committed.

  • japerry committed 9a8ec57 on 6.x-3.x
    Issue #848704 by japerry, DamienMcKenna: A blank div w/non-breaking-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.