I am using a ‘skins’ approach to loading css into my Zend Framework site.
From layout.phtml:
<head>
<?php
print $this->headTitle();
print $this->headScript();
$this->loadSkin($this->skin);
print $this->headLink();
print $this->jQuery();
print $this->layout()->customJS;
?>
</head>
where loadSkin() is a view helper that looks like this:
class Zend_View_Helper_LoadSkin extends Zend_View_Helper_Abstract {
public function loadSkin ($skin) {
$skinData = new Zend_Config_Xml('./skins/' . $skin . '/skin.xml');
$stylesheets = $skinData->stylesheets->stylesheet->toArray();
if (is_array($stylesheets)) {
foreach ($stylesheets as $stylesheet) {
$this->view->headLink()->appendStylesheet('$skin.'/css/'.$stylesheet);
}
}
}
}
Everything shows up fine in the browser (any graphical browser), including jQueryUI elements, like here: https://i.stack.imgur.com/70PVl.png.
But when I print, the css is completely ignored, like here:
https://i.stack.imgur.com/NGC25.png.
I am completely stumped – and can’t find anything here or on ZF forums about giving separate css parameters for printing. Any pointers would be greatly appreciated!
Thanks in advance,
-Roman
Iam not sure, but i think you have to set the MediaType for the CSS File:
View the following link for more information about the View-Helper for Stylesheets http://framework.zend.com/manual/de/zend.view.helpers.html#zend.view.helpers.initial.headlink