Is there a condition that I can include to supply different code for the 'email and 'print page' pop-up windows?
My client wanted to have his logo and address details included like a letterhead when people use the print page function. Good idea, no problem! - I cleverly included the code for that in index2.php, about line 145, also changed it to use a better stylesheet for print.
Problem is, the code that I included now also shows up in the 'email' pop-up window - they use the same bit of code.
So some kind of 'if' condition would be nice so that I prevent the branding elements that I included from showing on the email pop-up.
Here's the code that I would expect to modify from index2.php:
Code:
// start basic HTML
// this is the 'print page' html ... also the email page
if ( $no_html == 0 ) {
$customIndex2 = 'templates/'. $mainframe->getTemplate() .'/index2.php';
if (file_exists( $customIndex2 )) {
require( $customIndex2 );
} else {
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $mainframe->getHead(); ?>
// next line is modified to use a different style sheet
<link rel="stylesheet" href="templates/<?php echo $cur_template;?>/css/print_css.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<meta name="robots" content="noindex, nofollow" />
<?php if ($my->id || $mainframe->get( 'joomlaJavascript' )) { ?>
<script language="JavaScript" src="<?php echo $mosConfig_live_site;?>/includes/js/joomla.javascript.js" type="text/javascript"></script>
<?php } ?>
</head>
<body class="contentpane">
// here's where I added the print logo & address details
<?php mosMainBody(); ?>
</body>
</html>
Interestingly, my 'contact us' page still includes the web css, but thats a minor problem that I can probably eventually solve.
Im sure its dead easy when you know how.
Thanks for reading this far.