Is there anyway that the Inline Context Editor could be used without using the Admin module? I really like the idea of the inline editor but find the Admin module to be a clunky system (especially now that Drupal 7 has the "Dashboard" Interface.

Thanks,
Thomas Hansen

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmiccolis’s picture

Yes, this is possible, but requires some coding. Both Open Atrium and Managingnews use the context editor to manipulate dashboards. These are both Drupal 6 apps, but they should make it clear how you'd go about this.

Tebb’s picture

This would be good as when I enable the Admin module, my admin toolbar disappears.

I suspect that there is more than one module with conflicting javascript, but I'm not yet sure where these issues arise. Could be wrong.

fearlsgroove’s picture

I needed this too -- we use context, but toolbar not admin for drupal 7 -- so I made a VERY simple module that implements this as a link on the toolbar with a jquery UI dialog popup:
http://drupal.org/project/context_inline_editor

e2thex’s picture

In the Context_Field Module there is code that also does this, think it would be worth look at that and cotnext_inline_editor an buidling it in to context_ui

e2thex’s picture

Ok this patch adds a new option to the context settings. When this setting is on every contextual drop down gets an edit layout link. This link refreshes the page with the context inline editor in a dialog.

Most of this is coming from what was done in the context_field module. The second patch is for that module and it removed the functionality from it.

e2thex’s picture

This are the same patch but in the old patch format for old versions of make

jec006’s picture

Here is a version of the patch in #6 which applies cleanly using git apply (the one in #6 seems to fail silently).

jec006’s picture

I've begun a large amount of work to revamp and update Context UI and the additional features added by Context Field (which are ported over in the patch from #5 and #6). I'm doing this work in a sandbox here: http://drupal.org/sandbox/jec006/1478694

General Changes:

  • Removed Dialog for selecting active context, replaced with drawer style widget
  • Created a detached block browser with search filter and category filter
  • Removed drag and drop to add blocks, added 'Add a block here.' widget in each region
  • Removed ability to edit context conditions on front end as this almost always led to mistakes
  • Cleaned up javascript and css

This is obviously a fairly huge changed and will require a few iterations as we find and fix issues with both UX and general bugs.

I'm posting an initial formatted patch here for review, but please also go look at the code in its entirety in the sandbox.

I'm also attaching a few screenshots of it in action.

The Context switcher drawer:
context-switcher.png

jec006’s picture

FileSize
110.52 KB

Better view of the block browser

context-block-browser.png

jec006’s picture

Status: Active » Needs review
muschpusch’s picture

@jec006: it looks really promising and i will do some tests. [edit] i put the feedback in the sandbox issue queue[/edit]
@e2thex: the context_field patch doesn't apply anymore 1050724-patch-to-context-field-to-remove-context-ui-editor-make-D7.patch

e2thex’s picture

i have updated the context_field removal patch and started a ticket for it
patch http://drupal.org/files/1491008_Remove_Context_layout_link_0.patch
ticket #1491008: Remove Context layout link

jec006’s picture

I believe I'm ready (hopefully maintainers are willing) to pull the work done in my sandbox back in. It is described above, though there have been numerous ui and bug fixes since then.

I also added the patch from the following issue as it seemed particularly relevant:
#661094: Permission for context module patch in #29 committed

Additionally, it includes and updates the patches in this thread by e2thex.

My intent is to basically make the context editor much more usable and something that people can use by simply installing context and context_ui. I've added help text to the UI to assist users in figuring out whats going on. This text will most likely need more work.

While boxes is not required to work with this, numerous updates to boxes have been made in conjunction with this to make them more integrated.

I've attached 2 version, one of them is a formatted patch with multiple commits, the other is a normal diff (unsure which is preferable).

jec006’s picture

Found a silly comparison error when checking whether the context editor should be active

jec006’s picture

Here's another patch which includes this change

-    $page['content']['context_ui_editor'] = array(
+    //figure out which region to put it in - allow it to be configured for themes using different regions
+    $placement = variable_get('context_ui_editor_block_region', 'footer');
+    $page[$placement]['context_ui_editor'] = array(

to allow for changing the region which the block will get placed in - particularly useful for sites that don't use the content region / hide it on certain pages.

I have an issue on my sandbox ( #1509778: Add UI for setting region for context ui editor block placement ) to add the UI portion.

jec006’s picture

Annnnd forgot to attach the patch

tanc’s picture

Great work jec006! Was about to log a bug report against the old version of the inline editor but your version fixes the issue and improves greatly on the UI. Will test and report back any issues.

jec006’s picture

awesome thanks

jec006’s picture

Title: Inline Context Editor without Admin module? » Context UI Revamp
FileSize
49.6 KB

Here's an updated patch. Since the last patch I've fixed numerous (some of them fairly critical) issues

The log of commits is:
Fixed issues with failure to save context after edit
Issue #1515002 by DSheffler: Added Consider replacing "Stop editing layout" link with Cancel button.
Issue #1525662 by wbobeirne: Added Both name & description of blocks on UI. Cleaned up code and theming a bit
Issue #1525662 by wbobeirne: Added Both name & description of blocks on UI.
Issue #1509800 by wbobeirne | jec006: Added Resize Blocks on Drag.
Issue #1514046 by wbobeirne | muschpusch: Fixed omega theme.

Please post issues in my sandbox for right now until we get this committed

Thanks

arpieb’s picture

Minor edit to remove a trailing comma in a JavaScript property list that causes an error on IE7.

tirdadc’s picture

This is a re-roll of #20 with a fix that uses JS to set the Context UI's height to 60% of the window's height and allows users to scroll to the bottom items and Save button.

tirdadc’s picture

That one is a botch, use this instead.

tirdadc’s picture

This is an update of #22 with a fix for context_reaction_block.inc to make sure we don't have the 301 redirect issue that causes double AJAX calls on the homepage. See http://drupal.org/node/1561196 for a similar fix for Boxes.

There still is something going on with the 'add a block here' action not getting detached properly, so when you add multiple blocks / boxes it add them repeatedly.

tekante’s picture

Reroll of #23 fixing the detachment problem for add a block here, adjustment to make select context/hide tab display correctly in which required moving the scrollable portion into the item-list.

jec006’s picture

Added a better mechanism for turning off the context ui editor. In patch in 19 I removed automatically turning the context_editor off as it was causing issues on pages that have ajax requests.

In this patch, I've added that back in, but moved it from hook_init to hook_page_build so that it will only get turned off on a different full page being viewed.

Also, patch is updated to most recent version of context dev.
See here for differences: http://drupal.org/commitlog/commit/35134/0da5c8fe2238824999a40b8b9799ebe...

jec006’s picture

One more, This one simply increases the width of the box browser to accommodate longer block names.

tekante’s picture

Marking as a desired item for the D7 stable release

tanc’s picture

FileSize
73.03 KB

Any idea what the attached screen shot is showing when I select a context to edit? It seems to be breaking out of the UI.

nicksanta’s picture

Patch from #26 was causing problems with our Varnish setup as it is initialising a session for all users (even anonymous) in hook_page_build.

Patch attached to resolve that.

tekante’s picture

@tanc - that appears to be the reaction forms for the Theme HTML and Theme Page reactions.

tekante’s picture

Status: Needs review » Fixed

This has been committed and should be in the dev branch and releases post beta4 thanks for all the work.

Status: Fixed » Closed (fixed)

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

Paul Lomax’s picture

This update has broken the Admin module version? If Admin is no longer supported this should probably be reflected in the docs.