3212 Posts in 847 Topics by 809 members
|Go to End|
26 May 2010 at 4:57pm
I'm working on a website which will primarily be displayed in IE6. The design requires the use of transparent PNG images, and a solution I've used previously is a PHP script. The requirements of the script are as follows:
1. Before EVERYTHING in the entire site, the following function must be called:
2. After EVERYTHING in the entire site, the following must be inserted:
As you can see, I've placed the PNG fix script at /mysite/code/png_fix.php. The two changes above were inserted into /mysite/code/Page.php (at the beginning and end, obviously).
So, my question is: Have I inserted the PHP-based PNG transparency fix script in the right place?
26 May 2010 at 6:35pm
It seems like your PHP Code is capturing the whole page output and parsing it for PNGs.
That won't work inside Page.php, since that file holds the model and the controller and is not responsible for output. Your best bet would be to modify the template engine...
From my experience there are some very good JS implementations out there.. did you try this one: http://www.dillerdesign.com/experiment/DD_belatedPNG/?
26 May 2010 at 7:58pm
That's correct - it needs to capture the entire page's output. I'm not particularly concerned about the overheads/processing as this is an extremely small website that I would estimate will only pull in about 1000 hits per year, tops. This particular script is the only perfect solution I've ever come across - no bugs, no workarounds, and nothing to do except add those three lines of code.
I haven't tried the JS solution you provided but it seems like a bit of stuffing around to get it working (explicitly specifying elements etc) and I really want to get this site published this week. The client is every designer's worst nightmare lol
As a SS novice, and definitely not a programmer by any means, how would I go about modifying the template engine as per your suggestion?
27 May 2010 at 2:05am
Well, this is a really ugly hack and the community here will probably kill me for even posting something like this, but here we go:
Add your code to the sapphire/main.php file, like you did with Page.php (ob_start(); at the top, rest at the bottom of the file).
Please note: This code will affect all pages generated by SilverStripe, even the Admin section etc..
Also: Since you're messing with core files here, you can no longer update your SilverStripe installation easily. You would always have to hack main.php after an update.
I sincerely hope you find some time to further evaluate the JS solutions ;)
27 May 2010 at 1:27pm
Thanks! Unless there are major security issues, I doubt I'll ever upgrade this site (at least in its current form...). Hopefully IE6 is well and truly dead by that point
|Go to Top|