Page 1 of 1

phpwcms problem in IE

Posted: Wed 18. Aug 2004, 14:48
by jaredhales
I have finally finished my phpwcms page for my company. One of my coworkers just discovered a problem with printing in IE. If you go to:
http://www.perfectorder.com/index.php?about_directions
using IE v6.0 on WinXP and try to print the page, IE crashes. This does NOT happen if you click the "printer friendly" link at the bottom of the page and print from there, but rather, if you just try to print the page as it is initially displayed, IE crashes. (This may happen in other IE versions as well, but this is the environement we have gotten this to consistently happen with). I also got the same problem to occur on this page:
http://www.perfectorder.com/index.php?software_naxml

However, I discovered some of the other pages on our site print fine in both the "normal" view and the "printer friendly" view. The only common element I could find in these two "problem" pages that are causing the problem is that they both make use of the "text w/ image" content part.

It seems to me that is likely not really a phpwcms bug, but an IE bug. But, since most of our users are likely to be using a similar environment, it something that concerns me a bit. It would be nice to find out 1) why does it cause IE to crash and 2) if there is a workaround. After all, the directions page is likely one of the pages our customers are most likley to print.

Posted: Wed 18. Aug 2004, 15:43
by DeXXus
"wider.css" is the problem.

This block:

Code: Select all

#mainBlock {
	Z-INDEX: 10; LEFT: 220px; WIDTH: 710px; POSITION: absolute; TOP: 160px; BACKGROUND-COLOR: transparent
}
This section, in particular:

Code: Select all

POSITION: absolute;

Posted: Thu 19. Aug 2004, 18:13
by jaredhales
ok, so why does this only cause printing problems in some pages? i believe i am using wider.css for the majority of the site. what's a safe alternative to using absolute positioning?

Posted: Thu 19. Aug 2004, 18:20
by DeXXus
jaredhales wrote:ok, so why does this only cause printing problems in some pages? i believe i am using wider.css for the majority of the site. what's a safe alternative to using absolute positioning?
I honestly don't know. I don't ~believe~ that the use of absolute positioning is the culprit , in itself. It must be how it "relates" to the content underneath and/or the ordering of that content. I haven't looked into it deeper.

Posted: Thu 19. Aug 2004, 18:48
by jaredhales
ok, so if i setup an alternative stylesheet for the pages, like so:
<link rel="stylesheet" type="text/css" media="print" href="phpwcms_template/inc_css/print_layout.css" />

then whenever someone prints, it should try to make use of my printer friendly stylesheet. does that sound like it will be a good fix for the issue?

Posted: Thu 19. Aug 2004, 18:53
by DeXXus
Not sure. It seems like it ~should~ since your "printer-friendly" links use the same scheme.
http://www.codestyle.org/css/media/prin ... mary.shtml

Posted: Thu 19. Aug 2004, 20:04
by jaredhales
Dexxus, thanks for your quick replies. It seems that if I could do something of this sort:

Code: Select all

<link rel="stylesheet" type="text/css" media="screen" href="phpwcms_template/inc_css/wider.css">
<link rel="stylesheet" type="text/css" media="print" href="phpwcms_template/inc_css/print_layout.css">
It will work fine. But, as phpwcms works now, it puts this at the very end of the html <head>:

Code: Select all

<link rel="stylesheet" type="text/css" href="phpwcms_template/inc_css/wider.css">
Which uses wider.css for everything in IE. So, it seems I am stuck.

Maybe this should be a feature request for phpwcms. To specify that the chosen stylesheet is used for the screen shots, and that the "print_layout.css" will be used for printing. Because, as much as I would like them to, not all users are going to click on the printer friendly link to print web pages.

Posted: Thu 19. Aug 2004, 21:06
by DeXXus
If what you say is true, I suppose you could do an "ugly" hack in "index.php" where style is applied:
FROM

Code: Select all

<?php echo $block["htmlhead"] ?>
<script src="<?php echo ".".$phpwcms["templates"] ?>inc_js/frontend.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ".".$phpwcms["templates"]."inc_css/".$block["css"] ?>">
</head>
TO

Code: Select all

<?php echo $block["htmlhead"] ?>
<script src="<?php echo ".".$phpwcms["templates"] ?>inc_js/frontend.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ".".$phpwcms["templates"]."inc_css/".$block["css"] ?>">
<link rel="stylesheet" type="text/css" media="print" href="phpwcms_template/inc_css/print_layout.css">
</head>

Posted: Thu 19. Aug 2004, 21:10
by jaredhales
Actually, I think I found another ugly hack that will work for me that doesn't involve changing the phpwcms code. I'll give details once I get it working.