Download & Extend

Make inline admin links on field_collection_view into contextual links

Project:Field collection
Version:7.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:fago
Status:needs work

Issue Summary

Content editors on D7 are going to be always looking for and expecting to see contextual links, so it seems like an easy win to use contextual.module to display the admin links on the View field-collection items formatter. Awesome UI consistency.

Bonus for developers too, since contextual links will probably look good out of the box, and will need only minimal css tweaking if any.

First attempt patch to follow.

Comments

#1

Assigned to:jamsilver» Anonymous
Status:needs work» needs review

patch attached.

AttachmentSizeStatusTest resultOperations
field_collection.1281272.1.patch4.52 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch field_collection.1281272.1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.View details | Re-test

#2

Status:needs review» needs work

The last submitted patch, field_collection.1281272.1.patch, failed testing.

#3

I like this idea. What about moving the "Add" links in with "Edit" and "Delete"?

#4

I would love to make this switch, but the patch doesn't work with the current dev.

#5

I agree, removing the 'Edit', 'Delete' and 'Add' links and moving them into a contextual link (or just removing them altogether) would make for a more consistent user experience.

Edit: I posted this before realising that these links can in fact be removed by editing the 'Manage display' of the containing node. Perhaps this option should be off by default?

#6

@jamsilver Any chance on getting your patch pushed against the current dev?

#7

There are lots of problems with these links, another example is #1246778: Make Add/Edit/Delete links translatable.
However, people might be using them. I'm not 100% comfortable ripping them out like that.

Also, the patch seems like it needs a reroll.

#8

@tim.plunkett, I understand that there are people using them.
Putting this on DEV and commenting about it on the next stable release could help.
I am sure that these contextual links would be better from an UX point of view, though.

But there is the case of the people that don't have contextual.module enabled.
Providing one or another depending on this case would not be a good option, I think.

In the end, I think the adaptation effort would be a necessary evil.

#9

Assigned to:Anonymous» fago

Assigning to fago for his opinion.

#10

This should be optional - it's not only content editors that use these links. We present these links to end users in several cases, and the people that will be using these links (joe public) certainly won't be looking for contextual links. Contextual links are more of a backend thing, where as there is nothing restricting the ability to create/edit/delete field_collection items to backend use cases.

#11

While not strictly related, the following patch adds an 'Add another' menu item at the same level as the edit & delete field collection item paths - which is intended for use in contextual links, as it allows users to add additional items from where they are when viewing a host entity. (The normal add path would not be shown in the contextual link for a specific field collection item.)

AttachmentSizeStatusTest resultOperations
field-collection-add-another-1281272-11.patch2.15 KBIgnored: Check issue status.NoneNone

#12

Note: the above patch shows the 'add another' contextual link without checking access -- oops, this was just found on a client's UAT site! I'll work on a fix in the next few days and post a better patch.

#13

This patch replaces my patch above in comment 11. Again, note that this doesn't fix the original issue, but provides a new path that can be used in contextual links.

AttachmentSizeStatusTest resultOperations
field-collection-add-another-1281272-13.patch2.23 KBIgnored: Check issue status.NoneNone
nobody click here