Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
<!--[if lt IE 7]> Fatal error: Call to undefined function phptemplate_get_ie_styles() page-node-lightbox2.tpl.php on line 18
Merely copying original page-node-lightbox2.tpl.php gives error. I'd like to edit the tpl file but the original fails before editing.
I'm using Firefox 3, not IE.
Automatic Image Handling for Image node settings
Automatic handler for Image Nodes:
HTML Content grouped
Comment | File | Size | Author |
---|---|---|---|
#9 | lightbox-page-template-conditional-phptemplate-301814.patch | 927 bytes | AaronBauman |
Comments
Comment #1
stella CreditAttribution: stella commentedWhat theme are you using?
Comment #2
drupaldoug CreditAttribution: drupaldoug commentedZen Classic theme. But I tried other themes including stock. Accessing the lightbox gallery, they all crash with the error message:
<!--[if lt IE 7]> Fatal error: Call to undefined function phptemplate_get_ie_styles() page-node-lightbox2.tpl.php on line 18
Comment #3
stella CreditAttribution: stella commentedThe page-node-lightbox2.tpl.php is designed to work with the default theme, garland. That phptemplate_get_ie_styles() function is a garland function. You will need to modify this file to work with your own theme. It's only an example of what could be done.
Cheers,
Stella
Comment #4
drupaldoug CreditAttribution: drupaldoug commentedThanks for the clue. It's quite a surprise. I can't find the reference right now, but I believe the instruction was to copy page-node-lightbox2.tpl.php to your theme directory, not copy to your garland theme directory. If the file is not a generic example, it should be so described.
Thanks for the assistance.
Comment #5
stella CreditAttribution: stella commentedThe docs at http://drupal.org/node/252260 do say:
Cheers,
Stella
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
mandclu CreditAttribution: mandclu commentedJust ran into this issue myself. This template file could be made more compatible by at least wrapping functions that are specific to individual themes within "if (function_exists('[theme-specific-function-here]')) {}" tags.
Comment #8
eaochoac CreditAttribution: eaochoac commentedyes if (function_exists('[theme-specific-function-here]')) {} this is the best solution, I´ve added twice. Works perfect when adding lightbox2 to an html without any headers and you are using zen theme.
Comment #9
AaronBaumanThis issue persists to latest dev.
There is no reason one would want the lightbox page template to cause a fatal error out of the box, based on an undocumented and unenforced dependency on garland (a theme which is arguably past its prime). In the spirit of compromise, this patch adds "function_exists" calls to the template file (rather than removing them altogether).