Hi,

There is a way to choose list of nodes that can be referenced in CCK nodereference module. If flags could use this feature to determine list of nodes on which show flag, it would open a lot of possibilities and eliminate a need to manually code flag display in template files, since user could just create view that returns nodes that he wants. I guess, since code is already there, maybe flags can take use it?

Screenshots attached, one "Edit Choose flag - test02_1243304794782.png" is current settings and "Saite uz darbu - test02_1243304751244.png" is proposed version.

Comments

quicksketch’s picture

Title: choose nodes to display flag link on » Limit flaggable nodes using views

This could be interesting, but we'd need to be very aware of performance problems this could cause. The Node Reference module can barely get away with the feature to limit to the contents of a view because it only needs to do the view queries when editing the content of a node. Flag on the other hand would need to do this query every time ANY node is displayed so that it can display the Flag link, meaning this feature would likely have a significant performance impact.

henrijs.seso’s picture

Some caching are in order then OR maybe there is room for new module that caches views results for other modules to use.

henrijs.seso’s picture

new idea: for most people simple rules action "hide flag" would be enough. opened feature request (http://drupal.org/node/527064). Leaving this open for now.

quicksketch’s picture

Status: Active » Closed (won't fix)

This can also now be done in the 2.x version by implementing hook_flag_access() and hook_flag_access_multiple(). However the overhead of making the lists defined by Views sounds like a requirement that would best be left to an add-on module.

Of course if you want to be very manual (and not super-secure), you can just use hook_link_alter() and remove the flagging link in the 1.x version.