We love boxes and use them all the time instead of blocks. However, we prefer using admin:hover to edit boxes because we have both styling as well as wysiwyg problems with loading the inline editor.

The ability to turn off the inline editing links would be very useful for this module. Has there been any work for this?

Comments

Grayside’s picture

With the goal of the boxes settings being on a separate page?

adamgerthel’s picture

yes, with the goal of using the standard edit-box page found when using the blocks page for example.

adamdicarlo’s picture

Here's a solution until whenever this kind of feature is put into the Boxes module.

Stick this in your theme's template.php (and change THEME to your theme name) to turn off all ajax Edit links:

/**
 * Override theme_boxes_box() -- remove ajax edit links.
 */
function THEME_boxes_box($block) {
  unset($block['controls']);
  return theme_boxes_box($block);
}

You can also turn them off only for certain boxes (e.g., boxes in a region that inline editing makes no sense for):

/**
 * Override theme_boxes_box() -- remove ajax edit links for certain boxes.
 */
function THEME_boxes_box($block) {
  // Header region isn't such a good fit for inline editing.
  if ($block['delta'] == 'my_header_box') {
    unset($block['controls']);
  }
  return theme_boxes_box($block);
}

Also, the Contextual module is a great way to get groovy hover links on boxes (and blocks, views, nodes, comments) -- for boxes you get a Configure link which takes you to the admin page where you can edit the box content.

dalin’s picture

Title: Ability to turn off inline editing » Ability to choose between inline editing, or editing on a separate page
Version: 6.x-1.0 » 7.x-1.0-beta3
Status: Active » Needs review
StatusFileSize
new4.17 KB

Patch attached. If you have the Overlay module enabled this patch should allow you to use that.

Since edit-in-place has so many known issues I've gone so far as to set the default to edit on a separate page.

mrfelton’s picture

+1 for this. The patch in #4 works for me, and gets around the issues that make it impossible to edit boxes inline with WYSIWYG enabled

seanberto’s picture

+1. Inline editing is a great concept, but really challenging with many custom themes.

pixelsweatshop’s picture

sub. +1

adamdicarlo’s picture

Status: Needs review » Needs work

Awesome patch... works fine for me -- and I have some minor comments since nobody else has piped up.

+++ b/boxes.admin.incundefined
@@ -86,3 +86,20 @@ function theme_boxes_box($variables) {
+ * Menu callback for settings form. ¶

Whitespace error (extra space at end of line).

+++ b/boxes.installundefined
@@ -186,3 +193,10 @@ function boxes_update_6103() {
+  variable_set('boxes_edit_style', BOXES_EDIT_IN_PLACE);

I don't think this variable should be set like this -- it doesn't have any effect (and unnecessarily adds a variable to the variables table).

+++ b/boxes.moduleundefined
@@ -168,17 +181,28 @@ function boxes_block_view($delta) {
+        ¶

Whitespace error.

Edit: forgot to mention "Edit style" should maybe be more like "Edit location" -- I'm thinking "style" could be confusing to some users.

adamdicarlo’s picture

Whoops -- I thought that variable_set() was simply setting the default value. Nevermind -- it makes sense now.

dalin’s picture

Status: Needs work » Needs review
StatusFileSize
new2.54 KB
new4.18 KB

Made all proposed changes.

mrfelton’s picture

StatusFileSize
new4.19 KB

Not sure why the above was split into 2 patches. Here is one patch file that combines the 2 patches from #10

dalin’s picture

#10 is not two patches. It is a regular patch file plus an interdiff which shows what changed compared to #4.

mrfelton’s picture

I see. Thanks for clearing that up. Then the patch in #11 is the same as the one in #10

jobeirne’s picture

Status: Needs review » Fixed

Your patch has been committed here: http://drupalcode.org/project/boxes.git/commit/3fdd068. I've changed the default editing to happen inline. Thanks!

Status: Fixed » Closed (fixed)

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