Custom System Messages provides an alternative to one of the most annoying things with EE, which is the fact that all error messages, regardless of type or severity are filtered through the same template, which is only editable within the Control Panel, and it doesn’t even parse other template tags.
This extension lets you define any 2 templates within your template groups to be used as the error page. You have access to all the usual variables from the Specialty Templates, plus a new one, {referrer}. So on top of any EE template tag you want to use in the error page, you have {title}, {meta_refresh}, {heading}, {content}, {link}, and {referrer}. {link} can also be changed to render without the JavaScript history.go() method if you desire. There are 3 options which I called Accessibility in the extension settings.
The extension requires no core hacks. The alpha/beta versions did, but thanks to Nathan Pitman (Nine Four), we don’t need a core hack anymore.
Thanks to Mark Bowen and Nathan Pittman for beta testing this.
// Change log (for EE 1.6.8) 1.1 - Changed ext priority to 15, so it is processed last. Added support for System Offline Ext
// Change log (for EE 2.0 2.0 - Initial release
Thanks to Mark Bowen and Nathan Pittman for beta testing this.
And a massive thank you to you for creating this extension. I am currently using this on a site and have had absolutely no problems with it at all so far. This is by far one of the best extensions to date as it takes something that was always a bit niggling to have to re-design and makes it absolutely easy.
Thanks again for such a great add-on.
Best wishes,
Mark
Is it possible to design an extension where the error message is returned into the existing template via an eetag? This seems like the best solution, though I have no idea if it’s possible…
Ideally in your template you could specify an {error} tag to have a section where possible errors would show.
Thoughts?
There is one caveat right now, which is that if you’re using the Forum module, you can’t use this extension. The Forum module apparently runs through the template engine differently. This is something that I hope to fix soon, but I wanted to go ahead and get this version out to the community for testing and feedback.
It seems that in case Forums are rum through full template engine this incompatibility between this extension and Forum module should not arise. From user guide:
Running the Forums Through Regular Templates By default, the Forum Module utilizes its own light-weight template display engine, rather than utilizing main templating system in ExpressionEngine. The consequence of this, though, is that you can’t use general EE Tags, global variables, conditionals, or similar in the forum templates since they won’t be parsed. In the Default Preferences you set a “triggering” word for the forums, which by default is “forums”. When the trigger word is encountered in the URL by ExpressionEngine, your forums will display. Your trigger word cannot be the same as any existing Template Group name. If you absolutely must, there is a way to run your Forum through the standard EE template engine: 1. Create a Template as normal in the main Templates tab of the Control Panel. Name it as you want. 2. Inside that new Template, place this code and only this code:Your forum will then be run inside the regular EE template engine, which means that you can include standard EE Tags in the forum theme Templates. The forum is then accessed through whichever Template you created above, so the Template name is used in place of the “trigger” word mentioned earlier. The down side of this approach is that it adds more processing overhead, so it’s not recommended unless users really need this capability. Since the forum can’t be cached, on very busy sites this can create some unwanted server load. Do not cache the Template you create for the forum. If you do so, your forum will not behave dynamically.{exp:forum}
The error though is that the Template class can not be redeclared. I’m creating a new instance of $TMPL in the extension, because it didn’t work using the existing global. Perhaps I shouldn’t override the existing global in the extension?
In one of my extension I used this snippet to avoid redeclaring of Template class:
if ( ! class_exists('Template'))
{
require PATH_CORE.'core.template'.EXT;
}
$template = new Template();Just downloaded now. Will be sure to use this one on the next site I do as up until now I’ve always done a view source, copy and paste and then insert the necessary EE tags which is fine most of the time but means you have to remember to update it if you change a part of your design that would normally be kept in an embedded template.
Hello, I’ve placed the extensions in the correct folder, but it’s not showing in the extension manager. I’m using latest EE 1.6 build with MSM. Cheers,
Check the file permissions. On the first version of this that I tested out I had the same problem too and that was what was doing it.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.