Is it possible have an AJAX flag link in the teaser of a node and a regular flag link in the full node?
I know that with views I can create a regular link, one that reloads the page, regardless of what settings I have on an individual flag.
I'm hoping I could make the same kind of choice in a template file.
Thanks in advance for any help you can provide.
Comments
Comment #1
quicksketchYou can, but you can't use the flag_create_link() function. You'll need to manually set the link_type type and then do the theming yourself.
Comment #2
mooffie commentedNate, that code probably isn't forward-compatible (we're planning to streamline the access interface, don't we?).
I've opened a feature request: #405580: Add $variables parameter to flag_create_link()
Comment #3
quicksketchYes, it's likely that the code above would eventually change (say in a 2.x version), I really like mooffie's suggestion of making flag_create_link() take an argument, seems like it could be extremely useful.
Comment #4
halstead commentedRemoved a module hack that let us get a bunch of work done. Code from reply #1 does the same thing without changing the module.
Comment #5
quicksketchWhoa whoa whoa! Hacking a module (even temporarily) is a much worse solution. I'd suggest using my code from #1 until we get #405580: Add $variables parameter to flag_create_link() done. Or alternatively start working on a patch for #405580: Add $variables parameter to flag_create_link() and then you don't need to worry about upgrading if your site uses a patch that will eventually be committed.
Comment #6
mitchell commentedMarking as fixed.