Search code examples
joomla2.5joomla-template

Joomla 2.5 - Is it possibile to load system messages inside jdoc content?


I have the following code:

<div id="content">
    <?php if(count($app->getMessageQueue())) { ?>
        <jdoc:include type="message" />
    <?php } ?>
    <jdoc:include type="component" />
</div><!--#content-->

Everything works fine expect when there are error or system generated messages. When they are presented output looks like:

<div id="content">
    Some error messages
    <h1>Some page title</h1>
    <p>Some content</p>
</div><!--#content-->

I want to they looks like:

<div id="content">
    <h1>Some page title</h1>
    Some error messages
    <p>Some content</p>
</div><!--#content-->

So error messages should be below h1 tag and before p tag. How to achieve that without hacking core files?


Solution

  • If am not wrong, just swap the two lines (1st as component and 2nd as message).

    <div id="content">
        <jdoc:include type="component" />
        <?php if(count($app->getMessageQueue())) { ?>
            <jdoc:include type="message" />
        <?php } ?>
    </div><!--#content-->