We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom System Messages (ditch the Specialty Templates)

Development and Programming

Brian Litzinger's avatar
Brian Litzinger
704 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

Download Here

// 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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Joe Wolin's avatar
Joe Wolin
206 posts
16 years ago
Joe Wolin's avatar Joe Wolin

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?

       
Brian Litzinger's avatar
Brian Litzinger
704 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

Isn’t that what the {content} tag is? If you submit a form with 3 invalid fields, {content} would be a UL with 3 LIs, one for each field error.

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas
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:
{exp:forum}
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.
       
Brian Litzinger's avatar
Brian Litzinger
704 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

True, it shouldn’t happen. 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?

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas
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();
       
Brian Litzinger's avatar
Brian Litzinger
704 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

Laisvunas, I was adding that as you were posting your message. I uploaded 1.0.1, which seems to work fine with the Forum module as well. w00t!

       
Tyssen's avatar
Tyssen
756 posts
about 16 years ago
Tyssen's avatar Tyssen

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.

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
about 16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Great work litzinger, this extension is greatly needed 😊

       
pab514's avatar
pab514
181 posts
about 16 years ago
pab514's avatar pab514

This is awesome litzinger, Going to give this a try real soon.

       
Studio Meta's avatar
Studio Meta
105 posts
about 16 years ago
Studio Meta's avatar Studio Meta

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,

       
moogaloo's avatar
moogaloo
200 posts
about 16 years ago
moogaloo's avatar moogaloo

brilliant - a much needed extension. my only wish, would it be able to show errors / messages in a thick / light / modal box? Instead of directing to a page template, could it instead be output as an inline page content shown in a jquery style modal box?

       
Liam Crean's avatar
Liam Crean
121 posts
about 16 years ago
Liam Crean's avatar Liam Crean

Moogaloo

Could that not be done with ajax?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 16 years ago
Mark Bowen's avatar Mark Bowen
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

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.