News:

Looking for documentation? Take a look on our wiki

Main Menu

How to make all System Messages dismissable.

Started by kaiserdom, May 19, 2015, 02:08:16 AM

Previous topic - Next topic

kaiserdom

Hi there.
I'm  running Joomla 3.4.1 and VirtueMart 3.0.9. and  I'm very confused concerning the data-dismiss of System Messages. I'm trying to make all types of Notification(Warnings, Alerts, Notices etc.) Dismissable but after spending many hours and burning out my mind I decided that I need some help here. For example, when I update cart, I receive a notification with an option link "x" to close it, just like the image of the link below:
http://s14.postimg.org/j8rbcfmqp/Image_1.jpg

On the other hand, when I run a form validation like User Registration, it's impossible to close the Message Box because the "x" closure link is missing, just like in the following image:
http://s2.postimg.org/b2jyb4x7t/Image_2.jpg

I made many changes in the file mysite\layouts\joomla\system\message.php but nothing seemed to make the trick.  The default message.php is the following.

<?php
/**
* @package     Joomla.Site
* @subpackage  Layout
*
* @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license     GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

$msgList = $displayData['msgList'];

?>
<div id="system-message-container">
   <?php if (is_array($msgList) && !empty($msgList)) : ?>
      <div id="system-message">
         <?php foreach ($msgList as $type => $msgs) : ?>
            <div class="alert alert-<?php echo $type; ?>">
               <?php // This requires JS so we should add it trough JS. Progressive enhancement and stuff. ?>
               <a class="close" data-dismiss="alert">×</a>

               <?php if (!empty($msgs)) : ?>
                  <h4 class="alert-heading"><?php echo JText::_($type); ?></h4>
                  <div>
                     <?php foreach ($msgs as $msg) : ?>
                        <p><?php echo $msg; ?></p>
                     <?php endforeach; ?>
                  </div>
               <?php endif; ?>
            </div>
         <?php endforeach; ?>
      </div>
   <?php endif; ?>
</div>


I need help  :(

Studio 42

Hi,
check if you have not the file in your template:
JOOMLAROOT\templates\YOURTEMPLATE\html\layouts\joomla\system\message.php

The best way is to add a copy at this place and make the change here.

Greets,

Patrick

kaiserdom