Is there any way to totally disable Edit on all or some Views?

Comments

RobKoberg’s picture

This is why I am at the issues list. Is there some way to only edit a full node view? I am using a customized version of the latest common 3.3-dev. A group homepage has a group node, which I want editable by group admins, but I don't want the node teasers (group content) editable. Any way to to disable?

I am not seeing anything in hook_edit_editor_info_alter or hook_edit_editor_metadata_alter. I also tried to see if there is anything I can do in $(document).on('quickedit', function (event, status) { });

I am checking perms to see if the user has edit rights and display the link if so. There I could set a custom link and could trigger the edit behavior, but it still does not seem possible.
I have tried a test to see if I could just target the node I want in edit.js, like so:

  var app = new Drupal.edit.EditAppView({
    el: $('#node-39'),
    model: appModel
  });

but still, the whole body (all teasers) is editable.

Any way to do this?

wim leers’s picture

Title: Possible to disable Edit on Views? » Document how to disable in-place editing of a field
Component: Views integration » Documentation
Assigned: Unassigned » wim leers
Category: Feature request » Task
Issue summary: View changes
Status: Active » Fixed
Issue tags: +Spark

I've added the following documentation:

Q: I want to disable in-place editing for a field.
A: Any field that has the #skip_edit property set on it will not be made
   in-place editable. You can add this property through hook_preprocess_field().
   You must make sure that your implementation of that hook runs *before* Edit's
   implementation — you can guarantee that by modifying the weight of your
   module or implementing hook_module_implements_alter().
Q: I want to disable in-place editing of fields in a View.
A: It's possible to disable in-place editing in Views *completely* by
   implementing hook_module_implements_alter(), and removing
   edit_preprocess_views_view_field() from the list of implementations.
   Currently, it's not yet possible to disable in-place editing in only a
   specific View.

http://drupalcode.org/project/edit.git/commit/8df190f

Status: Fixed » Closed (fixed)

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