Is it possible to test the flag state of a node (whether it's flagged or unflagged) from the node template? I've created an Editor's Pick global flag (moderator access only) and I want to display an image or change some CSS if the node is flagged (I need to be able to place the image separately from the actual Flag/unflag link). I'm thinking along the lines of a simple "if flag is on then show image" php logic.
I don't know how to do it without access to the current flag(s) status. I printed the node variables and only came up with:
flag_node Object
(
[fid] => 3
[content_type] => node
[name] => favorites_artwork
[title] => Favorites - Artwork
[roles] => Array
(
[0] => 2
)
[global] => 0
[types] => Array
(
[0] => artwork
)
[flag_short] => Fav
[flag_long] => Add to favorites
[flag_message] => "[title]" has been added to your Favorites.
[flag_confirmation] =>
[unflag_short] => un-Fav
[unflag_long] => Remove from favorites
[unflag_message] => "[title]" has been removed from your Favorites.
[unflag_confirmation] =>
[link_type] => toggle
[show_on_page] => 0
[show_on_teaser] => 0
[show_on_form] => 0
[i18n] => 0
)
Only one of my three flags shows up in the node variables (they DO show up on the node and appear to work fine). It appears my approach is wrong. Any suggestions?
Comments
Comment #1
clockwood commentednevermind. I looked everywhere and it was there in face the whole time - http://drupal.org/node/305086