View Full Version : Standard Error Page
dfc005
02-11-2009, 08:29 PM
Is there some global function or check I can use to see if the current page is an error page? I have a custom right hand menu that I'd like to hide some stuff in when an error page is shown.
--------------- Added 1234391543 at 1234391543 ---------------
I'd also like to know if the same can be found out about the standard redirect as well.
Dismounted
02-12-2009, 04:52 AM
Add plugins at error_generic and redirect_generic and create a variable that sets to true. Check this variable in your templates.
dfc005
02-12-2009, 08:31 AM
OK, have created a plugin at error_generic that has this simple bit of code....
$hide_stuff = "true";
And the in my template I have this....
<if condition="$hide_stuff != 'true'">
<div style="width:300px;float:left;margin-bottom:5px;">
$poll_sidebar
</div>
</if>
Doesn't seem to be working though. Doesn't look like the template has the variable set.
Marco van Herwaarden
02-12-2009, 08:59 AM
Make sure that the variable is in global scope, add the following line as 1st line of that plugin:
global $hide_stuff;
dfc005
02-12-2009, 09:06 AM
Nope, still doesn't set any value. I must be missing something....
Dismounted
02-12-2009, 10:17 AM
Which template are you putting your code in?
dfc005
02-12-2009, 10:22 AM
It's a custom template that gets included via a different plugin. Could that be the problem?
Dismounted
02-13-2009, 08:53 AM
If the template is called before the variables are defined, it is not going to work.
dfc005
02-13-2009, 09:28 AM
So which gets called first? error_generic or parse_templates?
Dismounted
02-13-2009, 10:37 AM
parse_templates
Paul M
02-13-2009, 10:39 AM
Turn debug mode on and you will see all the hooks that are called and in what order.
dfc005
02-15-2009, 09:04 PM
parse_templates
Well then, I can't set a variable in error_generic to be used in parse_templates can I?
Any other ideas?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.