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

jamsilver’s picture

Assigned: jamsilver » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.52 KB

patch attached.

Status: Needs review » Needs work

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

joelstein’s picture

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

bryancasler’s picture

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

WebJohn’s picture

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?

bryancasler’s picture

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

tim.plunkett’s picture

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.

Fidelix’s picture

@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.

tim.plunkett’s picture

Assigned: Unassigned » fago

Assigning to fago for his opinion.

mrfelton’s picture

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.

james.williams’s picture

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.)

james.williams’s picture

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.

james.williams’s picture

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.

jmuzz’s picture

Assigned: fago » Unassigned
Issue summary: View changes

I see no reason contextual links shouldn't be available for field collection items. They seem to be all over the place on everything else when they are active. They can be hidden from some users via their permission. The links built into field collection can be hidden by using a different formatter.

It would be fine to make a patch that adds the contextual links even if the built in links are there too. If there are use cases this doesn't cover (somebody needs to use contextual links for something else but shouldn't have access to them for field collections even though they do need to edit field collections) it can be done in a followup.