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.
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.
Comments
Comment #1
we241 commentedI've also been trying to figure this out.
Comment #2
ramsamba commentedPlease 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
Comment #3
Island Dave commentedI'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.
Comment #4
zilla commentedthanks - 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 ;)
Comment #5
ckreutz commentedI 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.
Comment #6
zilla commented@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?
Comment #7
kbahey commented@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.
Comment #8
ckreutz commentedSorry, 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.
Comment #9
adrapper commentedVery 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
Comment #10
Apollo610 commentedIf 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.
Comment #11
pomliane commentedThis version of Flag content is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.