Customizing the print pop-up
As Andrew Eddie at The Art of Joomla reports, the file /templates/$template/component.php controls the print view of a given article. Component.php acts just like index.php, which controls your template layout, module positions and CSS, among other things.
Component.php can be equally customized with features like module positions and custom CSS files. This is done using the same methods as with index.php.
At the heart of component.php is:
Pop-up only Styles
To add a specific stylesheet for your print pop-up, simply change the stylesheet in the head section to one that suits your needs. I'd also recommend using the media attribute to limit this new stylesheet to print and / or screen. For example our head may now look like:
Depending on whether or not you have separated your stylesheets by form and function, you could even use @import to grab your typography, module overrides, browser normalization rules and other styles. In some cases you may need to add a few extra lines of CSS to our new screen.css file to override some of your other rules. For example, screen.css could look like:
Pop-up only Modules
Component.php allows for the same code to be used for creating module positions. This can be especially useful if you want a specific header image or content displayed on only certain articles when they are printed. To add a module position, use the same code that you would with index.php.
Since we want this to be displayed only certain print pop-ups, I use the countModules method. For example:
Now, you can create a new module to contain whatever content or images that you'd like, assign it to your newly created position ("popup" in this example) and control when it appears by use of menu assignments.
The final contents of your new component.php could look like: