I created a flag to globally promote/demote nodes, using the corresponding actions for flag and unflag.
This "somewhat" works, but the status of the flag does not match the status of the node, so sometimes it works, sometimes it doesn't.
This is because flag only create a record when someone flags something - so the flag always defaults initially as "unflagged" regardless the status of the node.
I did not found a clear explanation in the documentation that is more user oriented, bookmarking.
I know I can make it the hard way, syncing the flag status with the node status using rules, but it would be much easier to make what I wish without that module.
I simply wish a flag that suggest flagging when the node is not promoted, unflagging when it is , whoever the user.
So the flag status is either 0 if the node is not promoted, or 1 if it is.
Thanks for help
Comments
Comment #1
joachim commented> I created a flag to globally promote/demote nodes
This is a really bad use of Flag. Lots of people do this mind you, so you're not alone. But you're basically using Flag just for the UI, for a nice JS link. You don't actually need the flag, rather you want the link to change something else, here the promoted property of the node. There are several modules that do this.
Comment #2
jvieille commentedYou are right: I used Fasttogle that makes it.
Comment #3
joachim commentedYup, Fasttogle is one of the ones I was thinking of but couldn't remember the name. Cool!