Closed (fixed)
Project:
Flag
Version:
5.x-1.0-beta6
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2008 at 16:35 UTC
Updated:
6 Dec 2008 at 19:27 UTC
Hello, I'm having a hard time getting the is_flagged function to work within a contemplate "Body" template. Here is the code I am currently using (I have tried it with and without the $node-nid variable):
<?php
$flag = flag_get_flag('sold');
if ($flag->is_flagged($node-nid)):
?>
<li class="sold">Sold</li>
<?php else: ?>
<li class="price"><?php print $node->field_asking_price[0]['view'] ?></li>
<?php endif; ?>
I'm getting this error message:
warning: Missing argument 1 for flag_flag::is_flagged(), called in C:\wamp\www\*****\sites\all\modules\contemplate\contemplate.module(765) : eval()'d code on line 10 and defined in C:\wamp\www\*****\sites\all\modules\flag\flag.inc on line 397.
Am I not doing this correctly, or are these two modules not compatible with this function?
Thanks
Comments
Comment #1
sirkitree commented$node-nid is not a valid variable. try $node->nid.
Comment #2
XBleed commentedWow.. I feel really embarrassed. I could have sworn that I was using $node->nid.. I just gave it a go again and it seems to work now. I must have completely entered that wrong. My apologies.