replacing flag link with images doesn't work with current dev version

ju.ri - October 29, 2009 - 06:03
Project:Flag
Version:6.x-2.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

After testing the current dev version with the new anonymous flagging code (works great! thanks!), my custom flag images don't appear any more. I was using this method from the handbook to replace the links:
http://drupal.org/node/305061
Do I have to adjust the code in some way?
Thanks for helping

#1

quicksketch - October 29, 2009 - 07:47

The variable "flag_name_css" no longer exists in the 2.x version (all the classes are now grouped together as $flag_classes instead). Note that you'll need to delete/update any existing flag-*.tpl.php files you've overridden in you theme if you've done that also.

I've update the documentation to just use $vars['flag']->name instead, which should work just as well, except that it uses underscores instead of hyphens (so it would be "flag-my_bookmark-on.png" instead of "flag-my-bookmark-on.png"). It won't make any difference if your flag name is a single word.

So in short, open up your template.php file and in phptemplate_preprocess_flag() replace:

$vars['flag_name_css']

with
$vars['flag']->name

#2

ju.ri - October 29, 2009 - 14:25
Status:active» fixed

thanks a lot for the fast help! works great.

#3

System Message - November 12, 2009 - 14:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.