Hey guys,

I've a "like" button yet like facebook, but I want a "dislike" too. When a user click on "like", he shouldn't be able to "dislike" a node. Should I do that with css and rules?

What would you do?

Thanks

Yannick

Comments

quicksketch’s picture

yannickoo’s picture

But we have so much views with flag yet. But it's possible to unflag a node if it's glag as "dislike" or?

Thanks

Yannick

quicksketch’s picture

Flag is not meant to be a 3-way system. You can try and contruct one using 2 flags (one for like and one for dislike), but it will not provide you with the level of information you'd be wanting. You really should use Vote Up/Down if you want a "point-based" system that can go both up and down.

yannickoo’s picture

No, I don't want a point-system, I just want give users the option to dislike somethink and display which nodes are disliked.

And: If a node is liked, it can't be disliked.

No more :)

mooffie’s picture

Status: Active » Closed (duplicate)

And: If a node is liked, it can't be disliked.
No more :)

One option is to use the Flag Classes module, which, using CSS, lets you easily hide/show (or dim/highlight) elements that aren't relevant. So you could show only the relevant link (either 'like' or 'dislike').

But to actually enforce the access control you'd need to implement hook_flag_access(). It's possible that we'll have an easier-to-use feature: #952114: Have hook_flag_validate().

I'm marking this a duplicate of #952114: Have hook_flag_validate().