Rendering of template gallery.php failed is the only error I have:
This is a bad undescriptive error, I know. So what does it mean and how to I fix it?
Thank you for any help.
Rendering of template gallery.php failed is the only error I have:
This is a bad undescriptive error, I know. So what does it mean and how to I fix it?
Thank you for any help.
I'm completely lost with this and I definitely need help, so I'll bump this topic.
i need help with this too, please.
I've added the tag "nextgen-gallery" so the plugin author may respond, as was said on http://alexrabe.boelinger.com/forums/
Out of the blue, all my galleries have been replaced with "Rendering of template gallery.php failed". I am running NGG 1.2.1 My site is http://idrinkyourwine.com
Please reupload all files and check also the permission of the plugin folder nextgen-gallery/view
Oh, what permission is it supposed to be?
I have 755 for the nextgen-gallery/view folder.
I may have broke this when I had to change my file permissions for my blog because I kept getting 500 Server Errors.
And thank you for this fast reply.
i tried deleting and reloading the nextgen plugin. still the same error "Rendering of template gallery-extend.php failed"... also permissions are all 755 which i think is correct. what gives? please help.
this is the code i am using. as you can see the first gallery works. the second does not.
[nggallery id=1]
[nggallery id=1 template=extend]
I get the error "Fatal error: Allowed memory size of 33554432 bytes exhausted"
"nextgen-gallery/lib/ngg-db.php on line 429"
Have you the same failure with the wordpress default theme ? Please disable all other plugins for a test
I deactivated all other plugins and it doesn't work still.
I thought this would be the case because it stopped working at a random time without any changes.
Where is this error made? What file? I'd like to see if I can find any cause.
the file to render the output is view/gallery.php, if you want to use a template , the you need to have a gallery-extend.php file. See here for more info's : http://alexrabe.boelinger.com/2008/11/25/new-in-version-100-templates/
Okay, in lib/core.php where the error is made, which I found, I altered the error to give debug information. I replaced the render function with:
function render($template_name, $vars = array ()) {
foreach ($vars AS $key => $val) {
$$key = $val;
}
if (file_exists (TEMPLATEPATH . "/nggallery/$template_name.php")) {
include (TEMPLATEPATH . "/nggallery/$template_name.php");
} else if (file_exists (NGGALLERY_ABSPATH . "/view/$template_name.php")) {
include (NGGALLERY_ABSPATH . "/view/$template_name.php");
} else {
echo "<p>Rendering of template $template_name.php failed</p>
DEBUG INFOMATION:
TEMPLATEPATH: " . TEMPLATEPATH . "
NGGALLERY_ABSPATH: " . NGGALLERY_ABSPATH . "
template_name: ". $template_name;
}
}
Now I get:
DEBUG INFOMATION:
TEMPLATEPATH: /home/users/web/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/themes/fluid-blue-10
NGGALLERY_ABSPATH: /home/users/web/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/plugins//hermes/bosweb/web286/b2863/d5.godofgod/public_html/frd/wordpress/wp-content/plugins/nextgen-gallery/
template_name: gallery
So the NGGALLERY_ABSPATH is completely, bizarrely wrong. Where is that constant defined so I can fix it?
I recommend others try replacing the function and see what they get.
i tried the original wordpress theme + no plugins on. still BROKE. anyone have any ideas? sounds like it never worked stock without changing code?
Try what i suggested to see what you get.
I'm going to look for that constant in a little while.
I fixed this by finding in nggallery.php:
define('NGGALLERY_ABSPATH', str_replace("\\","/", WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . '/' ));
And I replaced it with:
define('NGGALLERY_ABSPATH', str_replace("\\","/", WP_PLUGIN_DIR . '/nextgen-gallery/' ));
But now the slideshow fails and all the pictures are in one column.
You have to modify how both NGGALLERY_ABSPATH and NGGALLERY_URLPATH are defined in order to solve this error. These are defined in nggallery.php around line 209 and 210.
The following definitions work for me..
define('NGGALLERY_ABSPATH', dirname(__FILE__) . '/' );
define('NGGALLERY_URLPATH', WP_PLUGIN_URL . '/nextgen-gallery/' );
I believe the problem is actually down to the function plugin_basename() not returning the expected response
this might help, got it from an earlier post,
Let me note :
if you add the gallery.php (form the plugin folder) to
{wordpress dir}\wp-content\themes\your theme directory\nggallery\gallery.php
then you can call it with [nggallery id=x]
if you need another template use the tag [nggallery id=x template=mysample]
and NextGEN Gallery look for a file in
{wordpress dir}\wp-content\themes\your theme directory\nggallery\gallery-mysample.php
There might also be other relevant discussion on gallery ID and templates read the whole thread for more.
This topic has been closed to new replies.