Instead of using the "Edit" text on boxes, we could take advantage of Contextual Links being part of Drupal core.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

e2thex’s picture

FileSize
623 bytes

So I looked in to doing something with contextual links but it is a bit hairy, and might be a bit restrictive for what boxes does. but this patch is a js fix the replace the block configure contextual link with the boxes edit link

febbraro’s picture

Status: Active » Closed (fixed)

Committed, thanks!

Alan D.’s picture

Status: Closed (fixed) » Needs work

Panels will create a conceptual link for the box, but without full control of the html, it may be hard to determine if you have this link or not. This works on our installation:

      //If we have a contextual link to configure the block lets get rid of that and move our edit link
      //to the contextual dropdown
      $('.boxes-box-controls', context).each(function () {
        // See if we are within a panel.
        if ($(this).parent().parent().hasClass("pane-content")) {
          $(this).hide();
        }
        else if($(this).parents(".block").find(".block-configure").length > 0) {
          $(this).parents(".block").find(".block-configure").after($(this).find("li.edit"));
          $(this).parents(".block").find(".block-configure").detach();
        }
      });
acrollet’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs work » Reviewed & tested by the community
FileSize
1.13 KB

Works for me, thanks! I've attached the code in #3 as a patch. This also represents a work-around for #1120782: Inline editing not working inside a panel.

tirdadc’s picture

Committed, but leaving this open as it might still need to be done the right way as far as the core issue goes instead of relying on a workaround.

tirdadc’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Hydra’s picture

Interesting, if you don't have permission to configure blocks, youre not able to use the contextual links! It might be the case, where you dont want your customer to have access to the block's configuration page and all blocks, that aren't boxes, but you still want the "edit box" link to appear as contextual link.

BWPanda’s picture

Status: Closed (fixed) » Needs work

I agree with #8 - you shouldn't need the 'Administer blocks' permission just to have the Boxes 'edit' link appear in Contextual Links.

This still needs work.

Elijah Lynn’s picture

Agree too, this is an odd permission to give for that.

minneapolisdan’s picture

Looks like this is a pretty old issue, but no one has solved yet? If anyone has solved it, please share.

rooby’s picture

Status: Needs work » Fixed

Putting this back to its previous status because there is another issue already with a patch for the permission issue.

See #1458570: "Edit boxes" permission is not enough for editing box content

jwilson3’s picture

For anyone interested, this patch (and/or latest dev release) will work much more smoothly if you also apply #1846570: Saving after edit in separate page brings you to the block page. ;)

Status: Fixed » Closed (fixed)

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

Pasqualle’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work

If the Contextual Links module is disabled, then there is no edit link on the boxes inside panels.

rooby’s picture

This issue was closed over a year ago.

I think you should open a new issue.
You can reference this one if it is relevant.

Alan D.’s picture

Status: Needs work » Closed (fixed)

agreed ;)

Pasqualle’s picture