How can i use (ONLY) Add link for a field_collection field within a view?
I have no success either to display with fieled collection data list (or view).

Files: 
CommentFileSizeAuthor
#12 1257274.12-field_collection-views_field_handlers.patch6.11 KBmrfelton
PASSED: [[SimpleTest]]: [MySQL] 163 pass(es). View
#11 1257274.11-field_collection-views-edit-delete-link.patch6.35 KBlathan
#6 1257274.Views_field_handlers.patch6.07 KBjerdavis
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View
#5 1257274.5-field_collection-views-edit-delete-link.patch4.09 KBmrfelton
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View
#4 1257274.4-field_collection-views-edit-delete-link.patch4.09 KBmrfelton
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View

Comments

tim.plunkett’s picture

Status: Active » Postponed
vasike’s picture

Status: Postponed » Active

it seems that related issue it's already fixed but didn't fixed the present one.

mrfelton’s picture

Title: Add link for the field collection within a view » Add, Edit and View link for the field collection within a view
Category: support » feature

Also need views field handlers for Add, Edit, and Delete fields - that should only show based on user permissions.

mrfelton’s picture

Title: Add, Edit and View link for the field collection within a view » Views field handlers for field collection 'action' links
Status: Active » Needs review
FileSize
4.09 KB
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View

Attached patch adds new views handlers that provide Edit and Delete links for field collection items.

mrfelton’s picture

FileSize
4.09 KB
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View

Fix whitespace issues.

jerdavis’s picture

FileSize
6.07 KB
PASSED: [[SimpleTest]]: [MySQL] 78 pass(es). View

Here is a different approach which more closely follows what Views itself is doing for similar action links for Nodes.

bulldozer2003’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

Another note is that you should not create a label in views for the links as the label will be shown to unprivileged users while the link is properly hidden.

bulldozer2003’s picture

If you are only displaying a single node's field collection items, another tip is to exclude the add item link from display. Then add a footer with the following global unfiltered text with "use replacement patterns" checked.

<ul class="action-links">
<li>[add_item]</li>
</ul>

If you don't exclude add item from display, it will be displayed in every field collection item.

fago’s picture

Status: Reviewed & tested by the community » Needs work

Those handlers should leverage the views' views_handler_field_enttiy (or how it is called), such as the node links do in View. Check them for example.

I do no think we should directly extend the node-link handlers. Semantically it doesn't make sense and I don't think it would bring us much.

jerdavis’s picture

@Fago #6 doesn't extend the node link handlers, did you take a look at it?

lathan’s picture

Reroll against latest dev.

mrfelton’s picture

Status: Needs work » Needs review
FileSize
6.11 KB
PASSED: [[SimpleTest]]: [MySQL] 163 pass(es). View

Patch from #6 updated against dev again