Adding a print stylesheet to Joomla!
The fundamental aspect of print stylesheets is linking them.
Getting ready
Open your template's index.php
file and locate the content within the<head>
section of the document.
How to do it...
1. Within the template's
index.php
file, add the following highlighted line within the<head>
element:<head> <!—some code omitted --> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/print.css;" type="text/css" media="print" /> </head>
This tells the template to insert a link to your print stylesheet. You should be able to see this HTML in your page once you've reuploaded the file:
<link rel="stylesheet" href="/templates/rhuk_milkyway/css/print.css" type="text/css" media="print" />
The print stylesheet is now linked to your Joomla! template. We'll add to the print stylesheet in subsequent chapters.
How it works...
In many web browsers, when you view the print preview or print a page, the...