Chapter 4. Print Configuration

This chapter goes into some of the more advanced configurations for changing the print output.

Methods of modifying print output

There are several ways in which Joomla itself prepares the print output of a page and these methods will of course apply to all printed output from the system, not specifically from the Timesheet component. This information is provided for user reference, since we have implements a more specific method to 'design' the Timesheet output very specifically.

HTML Boxes

The method that we have used to enable the site administrator to add custom HTML Codie to their print out is using what we have called HTML boxes. Effectively these are configuration parameters for the component that the site administrator can define. The next step is that we have modified our display template so that if the page is called with the parameters 'tmpl=component' then we know that the view is for the 'Print' popup window and can thus add conditional code into the template on that assumption. This works very well in practise and makes if very specific to any print changes required for our specific Timesheet component.

Common usages for the HTML box include presenting the company logo upon the output pages, and providing information upon the printed output for any intended recipient of the hard copy. Any valid HTML is acceptable.

Standard Joomla method

The following are copies of articles/information currently available on the web which are reproduced for the readers convenience. We take no credit for the works and although we believe the information to be correct can not be responsible for any inaccuracies contained therein.

Modifying the print output.

There is a reasonable article upon the Joomla website that covers the basics of how one may modify the 'print popup' window. https://docs.joomla.org/Customizing_the_print_pop-up.

The reader is recommended to read the article to get a better understanding if the uses of the component.php file.

It is very likely that the actual contents of the componnet.php file used on a site is very probably extensively different from the simple example given, but the structure will be consistent with the documentation.

Add logo to Joomla print popup

Several of the displays on the front end provide a small print icon so that the displayed information may be easily printed. It is an easy change to ensure that the company (or web site) logo is displayed upon all print output.

The instructions are modified from an original article in Joomla Magazine September 2011. It is included here so that others may make use of it. It describes how a company logo can be inserted into any printed document from the print icon on the site.

  • Copy the file ''component.php'' from the folder Joomla-installation/templates/system to the root of the template folder of your template that you are using: (for example: joomla-installation/templates/rhuk_milkyway/component.php).

  • If you need to overwrite some component.php in your new placed template folder, don't do it, as it may include code that the template needs to use (I don't know, but it's safer if you don't do this action in this case).

  • Now open the component.php file in your template folder (you can use wordpad)

  • Search for the line that states: <body class="contentpane"> around lines 47 on beez_20 template.

  • Now, copy and place this code right under it: <img src="/www.yourwebsite.nl/templates/your-template-folder/your-images-map/logo.png" alt="Logo" /> To use a relative URL use it relative to the httd directory. i.e. src=”<?php echo $this->baseurl ?>/templates/your-template-folder/your-image-map/logo.png” where you use the appropriate folder and logo name for your site.

  • Just change the source of the image so it matches exactly the image that you want included, and that's it!

Another alternative article http://www.voodish.co.uk/articles/add-logo-to-print-popup-in-joomla/ also goes into a little more details and we reproduce it below for reader convenience.

So you would like to add a logo and perhaps some other bits to the Joomla print popup page?

Easy, you will need to open your template component.php file and make some changes, shown after the break.

Make sure to backup your component.php first.

Begin editing component.php

Found in: yoursite.com/templates/your-template/component.php

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)

   if($_GET['print'] == "1")
   {
   echo "<style type=\"text/css\">
   table.pagenav{display:none;}
   p.buttonheading{position:absolute;top:1px;right:0;}
   p.buttonheading a {background:url(http://www.YOURDOMAIN.COM/templates/your-template/images/print.gif) no-repeat top left;height:16px;width:120px;display:block;}
   </style>
   
   <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/templatesyour-template/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, upload and test.

Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries