This has been asked already (https://www.drupal.org/node/2775531) but didn't outline how to accomplish it in a way I understood.

I have attached a png of my current Views setup for this - currently I am linking to a page showing the bookmarks instead of creating the Flag toggle - I would like the tab to toggle from Bookmark/Unbookmark.

CommentFileSizeAuthor
Bookmark.PNG17.58 KBsimone.chinook
Flag-Link-Tab.PNG76.29 KBsimone.chinook
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

simone.chinook created an issue. See original summary.

joachim’s picture

Category: Task » Support request

I don't see how building a View is relevant to what you want.

If you want a node tab to perform a flag/unflag action, you will need to write custom code for it, as I explained on the other support request.

simone.chinook’s picture

You're right, it wasn't relevant - I didn't understand how to interact with the local task menu beyond a View.

I tried building a custom module to hook into menu_local_tasks but couldn't figure out how to call the flag/unflag action / put it on every node - is this possible?

Thank you!

joachim’s picture

In your custom module, make a menu item which shows itself as a tab on all nodes.

In the menu callback for this menu item, call the flag API to perform the flagging, then redirect the user to the node path.