I have tried putting flag_create_link in my page-taxonomy.tpl file. I added the following code:

print flag_create_link('like', $tid);

but it gave:

An HTTP 404 error occurred
http://localhost/drupal/?q=flag/unflag&destination=taxonomy/term/74&toke...

I know nothing about coding so any help would be much appreciated. I am using drupal 7.9. I have also tried:

print flag_create_link('like', $term->tid);

and it gives the same result.

Comments

amsterdamdrupalnewbie’s picture

Priority: Major » Normal
amsterdamdrupalnewbie’s picture

Can anyone help me with this?

jamescl’s picture

This worked for me:

print flag_create_link('like', arg(2));

Tax term code snippets here: http://drupal.org/node/93813#comment-171738

I found that I had to enable 'Display link on taxonomy term pages' to get to show up, and then disabled it - possibly clearing cache would have done the same thing.

I used this is a block, rather than tpl.php, but assume will do the same.

amsterdamdrupalnewbie’s picture

Great thank you!

jamescl’s picture

Status: Active » Closed (works as designed)