system message HTML

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
loquela
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Tue Mar 11, 2008 10:41 am
Location: Manchester
Contact:

system message HTML

Post by loquela » Sun Jul 20, 2008 12:29 pm

Hi there,

Where in th eJooml adirectpry structure can I find the HTML code for the system message?

Code: Select all

<dl id="system-message">
<dt class="error">Error</dt>
<dd class="error message fade">
	<ul>
		<li>Username and password do not match or you do not have an account yet.</li>
	</ul>
</dd>
</dl>
Thanks in advance,

Loquela

 
User avatar
zanderp
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 155
Joined: Tue Apr 03, 2007 7:32 pm
Location: Weesp, NL
Contact:

Re: system message HTML

Post by zanderp » Tue Jul 22, 2008 10:35 pm

You can find it in: libraries/joomla/document/html/renderer/message.php
Sander Potjer - Joomla Community Leadership Team

http://www.aclmanager.net - Joomla! ACL simplified
http://www.perfectwebteam.nl - Perfect Web Team

loquela
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Tue Mar 11, 2008 10:41 am
Location: Manchester
Contact:

Re: system message HTML

Post by loquela » Wed Jul 23, 2008 7:45 am

Many thanks!

hebryan
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Oct 23, 2007 6:23 am

Re: system message HTML

Post by hebryan » Thu Aug 21, 2008 3:18 am

Just one search the post is the first result, thanks too!
But I wondered why not put the system message HTML in a module, easier to customize and also separate front and back presentation.

User avatar
muthujoomla
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Aug 07, 2008 8:21 am

Re: system message HTML

Post by muthujoomla » Mon Aug 25, 2008 12:40 pm

Really lots of thanks.. It helped me very much. :)

mag8
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Dec 22, 2008 10:56 am

Re: system message HTML

Post by mag8 » Sun Jun 07, 2009 2:55 pm

it's possible ,and how , to call in a component these kind of message?

Jerror :: something (txt) ??

User avatar
andpatton
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri May 29, 2009 3:50 pm
Contact:

Re: system message HTML

Post by andpatton » Thu Jul 16, 2009 4:59 pm

Do you mean how can you access the text of any currently set system messages?

If so, you can do so with just these two lines of code (taken from this thread: how to retrieve the system messages)
ianmac wrote:

Code: Select all

$app = &JFactory::getApplication();
$messages = $app->getMessageQueue();
This sets $messages as an associative array with all set system messages. Each value in it is an array with two values, which are "type" and "message". So, if, for example, you wanted to loop through the array to check for any error messages, you could do something like this:

Code: Select all

$app = &JFactory::getApplication();
$messages = $app->getMessageQueue();
$errors = false;
$errorMessages = array();
foreach ($messages as $message) {
	if ($message[type] == 'error') {
		$errors = true;
		$errorMessages[] = $message[message];
	}
}
You then have a boolean $errors telling you if there are any error messages and an array with the text of any error messages that exist. Hope that's what you're looking for!

alka_singh
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed May 12, 2010 9:30 am

Re: system message HTML

Post by alka_singh » Thu May 13, 2010 6:12 am

i have a query that how can i change the system message position to our requirment? pls help me out :)

User avatar
andpatton
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri May 29, 2009 3:50 pm
Contact:

Re: system message HTML

Post by andpatton » Thu May 13, 2010 2:44 pm

If I understand you correctly, you are talking about a different topic than the topic of this post, but I'll try to answer it quickly.
The system messages are included in your template with this statement:

Code: Select all

<jdoc:include type="message" style="xhtml" />
(the style ["xhtml" in this example] can be whatever you choose). So to change the system messages' position, you need to open your main template index.php file and move that code to wherever you want it to show up.

I hope this answers your question. If not, please try to clarify your question so I understand exactly what you want to do.

alka_singh
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed May 12, 2010 9:30 am

Re: system message HTML

Post by alka_singh » Fri May 14, 2010 4:39 am

Yes this works, actually i have a module for form submit, and i need to display a confirmation message on the module itself. But now by the above solution all the system messages are being shift to my module. I need only that modules messages to shift in not all.

User avatar
andpatton
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri May 29, 2009 3:50 pm
Contact:

Re: system message HTML

Post by andpatton » Fri May 14, 2010 3:20 pm

Mmm, I see. In that case, you'll probably want to put a conditional in your template to check if it's the module's confirmation page and if so, to display the system message in the desired position. You could take a couple different approaches.

First, if there is a particular language string (or multiple language strings, if it's a multilingual site) for the module's confirmation message, you can check for that language string in the system message buffer like this (put the following code at the top of your template file -- add php tags [<?php ... ?>] if it's not already in a php block):

Code: Select all

$modMessage = "Put the module's confirmation message here";
$sysMessages = $this->getBuffer('message'); // get system messages
$modConfirmation = (stripos($sysMessages, $modMessage) !== false);
The other method is to check the URL (more specifically, the URL variables) to see if it's the module's confirmation page. This will only work if the module submits the form using a number http request (as opposed to AJAX), and if the page the module loads on confirmation has any unique URL variables. You can check by trying to submit the form with SEF urls off and seeing what shows up int he URL. If you find any variables that work (for example, modconfirm=1), you can then check for it:

Code: Select all

$modConfirmation = (JRequest:getVar('modconfirm'));
This method has the benefit of simplicity, but you first have to figure it out. Obviously, you will have to replace 'modconfirm' with whatever unique variable/identifier you find. Also, it will work with SEF urls on, it's just helpful to turn them off for figuring out what you can use from the URL.

Regardless of what method you use initially, you should then use this where you would normally include the system messages:

Code: Select all

<?php if (!$modConfirmation): ?>
<jdoc:include type="message" style="xhtml" />
<?php endif; ?>
and this where you want to include the module's confirmation method (the only difference is no exclamation mark in the if statement):

Code: Select all

<?php if ($modConfirmation): ?>
<jdoc:include type="message" style="xhtml" />
<?php endif; ?>
This method isn't perfect; if you have multiple system messages and only one is the module's confirmation, they will both get displayed where you want the module message to be displayed. This is a problem if you would want them displayed in different places; in that case, you'll need more complicated code to parse the system messages and split the module confirmation message away to display it in a different place.

Good luck.

J_SB
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri May 14, 2010 3:11 pm

Re: system message HTML

Post by J_SB » Fri May 14, 2010 3:29 pm

Hi,

I`d like to deactivate this system message completely,

Image

is this possible?

thanks

SuilAmhain
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 26, 2010 9:07 pm

Re: system message HTML

Post by SuilAmhain » Wed May 26, 2010 10:11 pm

andpatton,

Thank you so much. I did it the following way.
I want the message to display in a custom location in alpharegistration but for everything else I want error messages to display as normal. (Also JRequest requires two colons.)

In the index.php for my template I did this:

Code: Select all

<?php $modConfirmation = (JRequest::getVar('com_alpharegistration')) ?>

<?php if (!$modConfirmation): ?>
         <div style="display:none;">
               <jdoc:include type="message" />
          </div>
<?php else: ?>                        
        <jdoc:include type="message" />                      
<?php endif; ?>
In the html override of default.php for alpharegistration I did this.

Code: Select all

<?php if (!$modConfirmation): ?>
         <jdoc:include type="message" />
<?php endif; ?>
Thank You ;D

elviscen
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sun Aug 23, 2009 8:53 pm

Re: system message HTML

Post by elviscen » Mon Oct 25, 2010 6:51 pm

J_SB wrote:Hi,

I`d like to deactivate this system message completely,

Image

is this possible?

thanks
I have the same problem.

Is possible to remove all system message from frontend?

I try to edit Index.php removing <jdoc:include type="message" />
I not have messages but is an line.
How can I remove this line?

User avatar
andpatton
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri May 29, 2009 3:50 pm
Contact:

Re: system message HTML

Post by andpatton » Wed Nov 03, 2010 3:33 am

J_SB wrote:I`d like to deactivate this system message completely,

is this possible?
Absolutely. You can use the code I already posted, but rework it for that message. Specifically, at the top of your template's index.php, you would put:

Code: Select all

$userMessage = "Username and password do not match or you do not have an account yet.";
$sysMessages = $this->getBuffer('message'); // get system messages
$showMessages = (stripos($sysMessages, $userMessage) === false);
Then, you find the line in your template that says

Code: Select all

<jdoc:include type="message" />
and you replace it with:

Code: Select all

<?php if ($showMessages): ?>
         <jdoc:include type="message" />
<?php endif; ?>
This has the disadvantages I mentioned in the end of my previous post, but it sounds to me like that won't be an issue for you.
elviscen wrote:I have the same problem.

Is possible to remove all system message from frontend?
That should be easy, but it sounds like you already tried to do so but didn't have success? Perhaps you should try doing it from the Template Manager within the Joomla backend. Go to Template Manager, click on your site's active template (or templates), click on Edit HTML, and look for <jdoc:include type="message" /> in the textbox that appears. You might just want to search for:

Code: Select all

type="message"
…so that you'll find any version of the above line that your template might use. If you find it, delete it and then save it. If you don't, then make sure to check any other templates you might be using on your site. Otherwise, the template you're using must be using some kind of custom way of displaying messages. If that's the case, you could try using css to set the system message elements to "display:none;", like:

Code: Select all

#system-message {
	display:none;
}
Hope one of those solutions works for you.

Clubnite
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Wed Oct 15, 2008 10:25 am

Re: system message HTML

Post by Clubnite » Mon Mar 21, 2011 6:45 pm

Is there a way to toggle this message box when using ajax? In my model i set messages to japplication. i read this array in my controller and echo them back to from where the request came. But i'd like to have this topic being handled in the typical manner using this message box.

How could one realize this?

User avatar
nkdweb
Joomla! Explorer
Joomla! Explorer
Posts: 264
Joined: Mon Jun 29, 2009 5:38 pm
Location: India
Contact:

Re: system message HTML

Post by nkdweb » Thu Aug 04, 2011 2:17 pm

Hi All,

When i click on the login button in the joomla login module continuously, im getting more number of system error message, please check the attachment.
system_message_issue.jpg
Please advice me how to fix this.
You do not have the required permissions to view the files attached to this post.
www.daylord.com - Exploring Joomla & other open source CMS.

 

Locked

Return to “Templates for Joomla! 1.5”