Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Display errors using Joomla error handler

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hello Team JB!
I use the New Lifestyle template.
I would like to leverage the Joomla error handler to display my own errors, warnings, etc.

Can you give me an idea of how I could do that with this template?

I'm thinking of using something like:
JFactory::getApplication()->enqueueMessage(JText::_('SOME_ERROR_OCCURRED'), 'error');

in my code.

Thanks in advance!
Pat
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Pat,

What is it that you want to display? The error handling would usually go into your logic that detects the errors.

That would probably be best in a plugin, or template override depending on what you are trying to do.

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Thanks, Rob.
I do have error handling in my logic. I have a php program that I run and thought it convenient if I could emit a Success or Error to the client using the existing Joomla error handling. Don't know how to bubble it up inside the JB New Lifestyle template, or even if it is possible.
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
There is an 'Auto message' area just above the 'Auto component' on my template layout.....
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Pat

All themes contain the Joomla message output.

In T3 based themes you can usually find it in /tpls/blocks/mainbody.php

Messages are only shown when something is in the queue to output, but you do not need to queue up your message in the template files, it can be a plugin or other extension.

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers