Closed (won't fix)
Project:
Views PDF
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2013 at 14:14 UTC
Updated:
29 Sep 2015 at 14:42 UTC
Jump to comment: Most recent
Comments
Comment #1
justluvgod commentedi am having the same issue
Comment #2
ivanilic commentedSame for me?
Thanks
Comment #3
ivanilic commentedThis was quick solution for me, hope someone can tell me if this can be done it other way:
In my views_pdf.modue file (in module folder) I've just changed in line 52 text $image to $title.
This way your module is printing views title instead of image.
This is part of code:
$imagePath = drupal_get_path('module', 'views_pdf') . '/images/pdf.png';
if ($image = theme('image', array('path' => $imagePath, 'title' => $title, 'alt' => $title))) {
return l($title, $path, $options ); // $image was instead of $title
}
As I sad, hopefully someone can show me better practice.
Thanks
Comment #4
killua99 commentedThis could be added for the next version.
I'll update the status of this issue but please if you bring any patch for the current stable version I'll review it and if I see if good enough I'll commit it.
Comment #5
killua99 commentedComment #6
stephandale commentedHi all. I know this issue is closed, but I thought I'd chime in with a Drupal-friendly way to change the icon, for future reference. Best not hack module code as it'll revert when the module is updated.
The views_pdf module defines the 'views_pdf_icon' theme registry key in views_pdf_theme(), which makes Drupal use the module's theme_views_pdf_icon() to theme the icon.
You can alter the registry so that it uses your own function.
Create a module (called 'mymodule' in this example) and add an implementation of hook_theme_registry_alter() to change the icon theming function, alongside your implementation of the icon theming function (mymodule_theme_views_pdf_icon() in this example).
In this example, the mymodule_theme_views_pdf_icon() function is exactly the same as the one from views_pdf-7.x-1.4. Change it as you wish :-)
P.S. Ignore the closing '?>' - you wouldn't normally add that to the end of module code. I had to add it to get the syntax highlighting.
Comment #7
stephandale commentedI should also have said that you could change one line in mymodule_theme_views_pdf_icon() to have your own icon used:
That will load mymodule/images/pdf.png instead of the views_pdf icon.