It would be very handy if this module ensured that an "Edit field" link was added to the block contextual links, since the content managers would probably otherwise expect to be able to edit the content on the "Configure block" contextual link.

Patch to follow.

Comments

jamsilver’s picture

StatusFileSize
new2.07 KB
new1.73 KB

This patch adds the contextual links for the node that owns the field and then modifies them to make them more intuitive to the user.

jamsilver’s picture

Assigned: jamsilver » Unassigned
Status: Needs work » Needs review

forgot to change to needs review.

sydneyshan’s picture

Status: Needs review » Reviewed & tested by the community

I've applied this patch and it's working nicely. I'd only suggest the menu link be changed from 'Edit field' to 'Edit node' as this is more accurate and less confusing to end users.

damien_vancouver’s picture

Status: Reviewed & tested by the community » Closed (fixed)

I updated this patch to work against the 7.x-1.x-dev code base, which also supports cck_blocks of taxonomy terms and users.

The code from #1 needed some slight modifications, and we could use additional code (see the @todos) to support better contextual links for taxonomy terms or users or any other entities being added (like commerce_product which I will be adding later today).

@jamsilver, It's committed with attribution to 7.x-1.x-dev in: http://drupalcode.org/project/cck_blocks.git/commit/88af7d2

Please give 7.x-1.x-dev a test for me if you can, and confirm this functionality is still working as expected!

@sydneyshan, I did not modify the contextual link to say "edit node" as that will be incorrect later when we add contextual links for users, terms, and commerce products. Complicating this is that cck_blocks_contextual_links_view_alter() does not know which type of entity has been presented. I explored using xdebug but all that's available to that hook is the rendered markup, there is no obvious (to me) way to figure out the entity_type. So, "Edit Field" is probably a nice generic title that will make the most sense across {node,term,user,commerce_product}. If you can think of better wording that doesn't say "node", we can update to that.. please let me know!

Thanks to you both for the patch and your testing.