When you enable front-end editing of blocks, aloha copy's all html in that block when you save. So, contextual links are also copied.

This should be filterd some how if contextual module from drupal core is enabled.

CommentFileSizeAuthor
#1 Screen Shot 2012-03-13 at 13.23.06.png319.58 KBmuhleder

Comments

muhleder’s picture

StatusFileSize
new319.58 KB

On my copy (using omega theme) the contextual links are not in the same block as the content. Perhaps your theme doesn't make the separation between block links and content?

The place to fix this would be in the module's aloha.js

Somewhere in

    // Strip our span target and any following tags from content to be saved.
    getContentFromContainer: function(container) {
      var $containerClone = jQuery(container).clone();
      $containerClone.find('.aloha-target, .aloha-target ~ *').remove();
      return $containerClone.html();
    },

we could add another line which removes any known tags we don't want to be added to the content. I've got a feeling this should be initialised as a setting something like
Drupal.settings.aloha.removedTags = ['.contextual-links']
so that site builders can add to this setting if they have other tags that also need to be stripped.

Frederic wbase’s picture

Yes indeed, it would be wunderfull if this is an extra setting. For the moment i will seperate the contextual links from the content area so that the problem is solved for the moment.

Our themer just loves a clean html output. Thats why we removed the extra divs (btw, we use boilerplate based theme)

muhleder’s picture

Assigned: Unassigned » muhleder
Status: Active » Needs review

Ok, have just pushed an update which should enable this. From the documentation added to the README


Certain elements need to be removed from the content before being sent back to
the server to be saved. These include the aloha target spans themselves, any
elements added after the aloha target spans (eg context can add target links to
the content area) and contextual links (dependent upon your theme).
If you need to remove other elements you may override
Drupal.settings.alohaElementsToStrip
which is a simple jQuery selector string listing the elements to be removed.
It defaults to
Drupal.settings.alohaElementsToStrip = '.aloha-target, .aloha-target ~ *, .contextual-links-wrapper'
so remember to include these in your override.
You should be able to override this from within a module or from your theme js.

Bit annoying having to add a new namespace within settings, but if we tried to use something like Drupal.settings.aloha.elementsToStrip then it gets zapped when the module adds the aloha settings. So in order to keep the code visible within the js file we need to add a new namespace.

If you could check whether this works for you with your original theme that would be great. Should be available from git now, and from the dev tarball after the next packaging.

Frederic wbase’s picture

Wow, thanks for the quick respone and fix an this one!

I will test is this afternoon and report my feedback in this issue.

grts

fre

muhleder’s picture

Status: Needs review » Fixed

Marking this one as fixed. Please reopen if you are still experiencing issues with the latest release.

Frederic wbase’s picture

Its seems to be fixed now, thanks m8!

Status: Fixed » Closed (fixed)

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