Change the "flag this" text link to an image?
cpract - August 21, 2007 - 20:45
| Project: | Flag content |
| Version: | 5.x-2.5 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
How can I change the "flag this" text link to an image of choice? It would also be a great feature to add to future releases.

#1
I've also been trying to figure this out.
#2
Please also allow the "flag this" text to be changed.
i think this change has to be effected in 3 places:
1. before the content is "flagged": seen as "flag this"
2. admin sees flagged item: seen as "unflag"
3. other users see it; seen as "flagged"
thanks
#3
I've not prepared a full drupal integration, but a quick hack is the following:
in flag_content.module:
function flag_content_link .....
go down to
if (is_numeric($eid)) {
$options = array('class' => 'flag_content');
if (!_flag_content_check($eid, $type)) {
// Not already flagged, flag it for admin
$links['flag_content_add'] = array(
'title' => 'flag this',
Change 'title' and add the 'html' element:
'title' => '
<img src="http://foo.example.com/files/dead_link.jpg" alt="Dead Link?" />','html' => TRUE,
Like I said, a quick hack, but effective if you need it in the short term. Would love to see this integrated properly into the module.
#4
thanks - i'm reluctant to edit the module file because there will eventually be an upgrade...
for now, those interested can use string override module to change flag this (text / system content) -it's very easy. but i too would like a simple image option built into the module with a standard icon recognizable for this type of thing (like an exclamation point or yellow triangle or something universal like that) - and it can be done with css, but why ;)
#5
I solved it differently and just added an background image in the standard theme CSS file.
.flag_content_add a{
background:url(path_to_theme/images/flag.gif) top left no-repeat;
padding:0 0 6px 13px;
}
This leaves the module untouched.
#6
@ckreutz - would this work for 'multiple images' (flag, unflag, etc)? also, could this be implemented with css injector module, or must this change happen directly in the theme's style sheet?
#7
@ckreutz
Can you please document that in the README.txt and attach it to this issue?
I will then commit it, so people can get those instructions without having to search the issue queue.
#8
Sorry, I do not know whether it works with multiple images. Is there still a need to implement it to the readme.txt? Sorry forgot to look back here.
#9
Very easy,
I just wanted to change the text not add an image. editing this file easy and worked.
Make a back up in case you make a boobo.
Andrew
#10
If you just want to change the text, check out the String Overrides module.
It allows you to change most text without having to modify the modules directly.