print function does not include the print_layout.css
print function does not include the print_layout.css
Hi everybody,
I've just updated to the 1.2.8 and everything works fine for me.
Now I have a litte trouble with the built-in print function:
First I had to comment out line 62 in switchFontSize.php that has caused an php error when rendering the print page.
Now I found, that the print_layout.css gets not included into the generatet print page and therfore I cannot customize the print layout.
Does Anyone have an idea?
Thanks in advace.
silver
I've just updated to the 1.2.8 and everything works fine for me.
Now I have a litte trouble with the built-in print function:
First I had to comment out line 62 in switchFontSize.php that has caused an php error when rendering the print page.
Now I found, that the print_layout.css gets not included into the generatet print page and therfore I cannot customize the print layout.
Does Anyone have an idea?
Thanks in advace.
silver
phpwcms 1.2.8 (20060825) · rewrite on · no mods
PHP Version 4.4.2 (CGI)
PHP Version 4.4.2 (CGI)
Re: print function does not include the print_layout.css
How about listing the "actual" error?silver wrote:First I had to comment out line 62 in switchFontSize.php that has caused an php error when rendering the print page.
Hi DeXXus,
the error when NOT commenting out line 62 was:
After I Had commented it out, the print layout renders, but the print_layout.css is not included. (When I look in the source code of the rendered print layout in my browser, I see, that there is no CSS File included.)
BR
silver
the error when NOT commenting out line 62 was:
Code: Select all
Fatal error: [] operator not supported for strings in /neu/phpwcms_template/inc_script/frontend_render/switchFontSize.php on line 62
BR
silver
phpwcms 1.2.8 (20060825) · rewrite on · no mods
PHP Version 4.4.2 (CGI)
PHP Version 4.4.2 (CGI)
Just replace
with
and everything seems to work 
Code: Select all
$block['css'][] = 'fontSize/'.$newFontSizeCSS;
Code: Select all
if(is_string($block['css']))
$block['css'] = array($block['css']);
$block['css'][] = 'fontSize/'.$newFontSizeCSS;

- Oliver Georgi
- Site Admin
- Posts: 9917
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
It's fixed. In content.func.inc.php around line 360 change it to this
Oliver
Code: Select all
//if print layout should be shown
$block["css"][] = 'print_layout.css'; //sets css to standard printing layout
print_leayout.css not included in v.1.3.3 ?
Is this still missing in v1.3.3 ???
Re: print_leayout.css not included in v.1.3.3 ?
The whole "method" was changed right AFTER this thread:vlado wrote:Is this still missing in v1.3.3 ???
"changelog.txt"
2006-08-17
[FIX] Print CSS file is added as array element now - the original has set $block['css'] back to string which might result in an error.
OK, it ~looks~ like this thread answers your question:vlado wrote:So how does it work now? It still does not include print_layout.css when I use [PRINT] tag in 1.3.3
http://www.phpwcms.de/forum/viewtopic.p ... int+layout
Wrapping your [PRINT][/PRINT] tags with the <!--NO_PRINT_START//--> and <!--NO_PRINT_END//--> delimiters
BUT that seems to be BECAUSE the coding to apply "print_lauout.css is written like this in "content.func.inc.php":
Code: Select all
// check if print mode - then try to replace "no-print" sections from source
if(strpos($content['all'], 'NO_PRINT')) {
if($aktion[2] == 1) {
$content['all'] = replace_tmpl_section('NO_PRINT', $content['all']);
$block['css'] = array('print_layout.css');
} else {
$content['all'] = str_replace(array('<!--NO_PRINT_START//-->', '<!--NO_PRINT_END//-->'), '', $content['all']);
}
}
Try changing this portion:
Code: Select all
} else {
$content['all'] = str_replace(array('<!--NO_PRINT_START//-->', '<!--NO_PRINT_END//-->'), '', $content['all']);
Code: Select all
} else {
$content['all'] = str_replace(array('<!--NO_PRINT_START//-->', '<!--NO_PRINT_END//-->'), '', $content['all']);
$block['css'] = array('print_layout.css');
Ok, now I see. So I have two options:
1. include in my print.tmpl <!--NO_PRINT_START//--><!--NO_PRINT_END//-->
this is an only way how content.func.inc.php replaces all other xxxx.css with only one - print_layout.css in page without changing php code.
2. change code in content.func.inc.php
I think more logical than Dexxus way is to add a line under this comment line as Oliver suggested but I want to replace frontend.css not just add print_layout.css:
In this case you don't need to worry about NO_PRINT tags at all and it will replace only first css (usually frontend.css) by print_layout.css.
Am I correct?
1. include in my print.tmpl <!--NO_PRINT_START//--><!--NO_PRINT_END//-->
this is an only way how content.func.inc.php replaces all other xxxx.css with only one - print_layout.css in page without changing php code.
2. change code in content.func.inc.php
I think more logical than Dexxus way is to add a line under this comment line as Oliver suggested but I want to replace frontend.css not just add print_layout.css:
Code: Select all
//if print layout should be shown
$block["css"][0] = 'print_layout.css';
Am I correct?