Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
Bookmark.PNG | 17.58 KB | simone.chinook | |
Flag-Link-Tab.PNG | 76.29 KB | simone.chinook |
Comments
Comment #2
joachim CreditAttribution: joachim as a volunteer commentedI 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.
Comment #3
simone.chinook CreditAttribution: simone.chinook commentedYou'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!
Comment #4
joachim CreditAttribution: joachim as a volunteer commentedIn 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.