rodge
rodge

Reputation: 264

Joomla Error Message File Directory

I was trying to learn how to create a joomla template. I successfully override some modules and components on my template however I can't override the error message especially on form validation.

I would like to know where the files are located and is it possible to override? My purpose is to add some bootsrap classes and add more tags on it.

Upvotes: 0

Views: 164

Answers (2)

YellowWebMonkey
YellowWebMonkey

Reputation: 1126

The actual generated system message is in /layouts/joomla/system/message.php

<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) : ?>
        <div class="alert-message">
          <?php echo $msg; ?>
        </div>
        <?php endforeach; ?>
      </div>
      <?php endif; ?>
    </div>
    <?php endforeach; ?>
  </div>
  <?php endif; ?>
</div>

Upvotes: 1

Alex
Alex

Reputation: 1295

You can fix template CSS at /template/(your_template)/css/template.css Or you can make new CSS with /template/(your_template)/css/my.css and include it in the /template/(your_template)/index.php:

$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/my.css');

If you need to temporary override CSS class from your CSS you can use " !important" about the overrided attribe in the CSS file.

Upvotes: 0

Related Questions