Page 1 of 1

add logo to page generated by the "print" button

Posted: Thu May 31, 2007 4:27 pm
by jpoo
How do you add a logo to theĀ  page generated by the "print" button. I have searched through out the forums.
Sounds like a custom CSS is required. Are there better instructions? I absolutely love this product and thank Joomla Group for all their good work.

Re: add logo to page generated by the

Posted: Tue Nov 25, 2008 6:26 pm
by nealb
Is there a way this can be done in Joomla 1.5? Aside from a logo, I'd like to add a copyright notice. It can't be too hard...I just don't know where to look. Any help would be most appreciated.

Thank you!
Neal Bowes

Re: add logo to page generated by the

Posted: Wed Nov 26, 2008 3:27 pm
by nealb
OK, here's one possibility, but it has a limitation...

You can control the style of the print document by creating template.css and placing it in templates/system/css.

In template.css, you can enter...

Code: Select all

body:before {
Works great in Firefox...and almost every other browser except IE. ":before" won't be supported until IE8.

Meanwhile, I was looking at the query sting that calls the print page and noticed "print=1." It shouldn't be too hard to come up with an if statement based on print=1 that would echo the logo right before the main content. Only thing is, I'm new to Joomla...and sorta new to php, for that matter...and I don't know what file to edit. Anybody else know?

Neal Bowes

Re: add logo to page generated by the

Posted: Wed Nov 26, 2008 3:50 pm
by nealb
OK, here's what I did...and it works...and I didn't see anything else that it screwed up (bonus)!

In the file templates/system/component.php at around line 26 is the body tag.
After that line, I inserted the following code...

Code: Select all

if($_GET['print'] == "1")
    echo "<img src='http://www.path-to-your-logo.jpg'>";
Even IE can handle this.

It stands to reason that you could put similar code right before the closing body tag and echo a copyright notice.

Again, I have no idea if this is messing up something else, but I think it's ok.

Have Fun.

Neal Bowes

Re: add logo to page generated by the

Posted: Wed Mar 11, 2009 7:34 am
by gunsta
Hi ;)

Hmmm... try to use VidLogo it help me and i hope it help you :)

Good Luck 8)

Re: add logo to page generated by the

Posted: Thu Mar 26, 2009 4:28 am
by boleroinc
nealb.. strange.. I tried that but it doesn't work here : shrug :

Re: add logo to page generated by the

Posted: Thu Mar 26, 2009 1:32 pm
by nealb
Hi boleroinc,

I don't know why it wouldn't be working. What's it doing?
My usual mistake is having the wrong URL to the .jpg.
BTW, I'm using Joomla 1.5.9. idk if other versions have a different file structure.

Re: add logo to page generated by the

Posted: Tue Oct 20, 2009 6:01 pm
by HWI
Following nealb's example (thanks a lot - saved my day!). I got around to get some control over the print page output.
I would like to hear if anyone know if the way of doing this through the component.php can generate unforeseen issues - as I did not see any at this point.

For others looking to modify the print page output I will share what I did below.
My intentions was:

Get a logo in the print page
Get some text reflecting the domain the print was done from


Get rid of pagination images/text in the print output window
Move the "print" icon to a better place in the print output window
Make the "print" icon more explanatory to users that they would need to click it once more to get the printing going.

1 logo (80x80 pixel) logo.gif
(placed in: )

1 graphic (120w x 16h pixels) print.gif
with a color and the "click to print" text written on it text aligned to the right leaving space for the print icon image to the left.
(placed in: )

Joomla 1.5.14
template: rhuk_milkyway
SEF = ACEsef

(I used this instead of the one placed in

My example is with a joomla article that have "pagination=on" and show "icon" for print (so if your "print button" is pure text there would be variation in how the below is done - but basic the same)

I am not a programmer so this is purely done with nealb's idea and with my knowledge of css. So no warranty on my side ;)

Navigate by FTP client or on your local machine to the folder:
(or the template you use - if no component.php i present copy from the above folder and put in there)

Backup the component.php before editing

Open the file with a text tool like "Notepad" so no formatting is messing up the code.

Place/save your graphic (logo and the "click to print" graphic) in the folder:

Start modify the component.php file around line 26 (just after : body class="contentpane" )

Insert the following code (Do not forget to edit all domain names - file names and folder names to what reflect your situation) :

Code: Select all

if($_GET['print'] == "1")
    echo "<style type=\"text/css\">
    p.buttonheading a {background:url(http://www.YOURDOMAIN.COM/templates/rhuk_milkyway/images/print.gif) no-repeat top left;height:16px;width:120px;display:block;} 
    <div style=\"height:98px;width:100%;border:1px solid #b1b1b1; \">
    <div style=\"background:#7c7c7c;height:16px;width:100%;display:block;\"></div>
    <img style=\"float:left;\" src='http://www.YOURDOMAIN.COM/templates/rhuk_milkyway/images/logo.gif' />
    <h4 style=\"float:left;margin-left:50px;color:#b1b1b1;font-weight:normal;margin-top:45px;\">SITENAME GOES HERE :: www.DOMAINNAME.COM ::</h4>
</div> ";   
Save the file - do not forget it need the extension .php after the filename - Go to your page and click print icon to see if it works
If no show check you domain- file- folder-names

Hope this helps someone - without any knowledge on php or css.
And again I would love to hear from someone if this could pose unforeseen issues.