Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am using joomla 3.x and have restricted access of some articles to certain user groups. When I am not logged in I get a really ugly message "You are not authorized to view this resource".

I would like that the user sees instead a custom message and a login screen, you know the basic "Thank you for your interest in …………… please register or login" message. Is it possible to change this in the code of joomla or is there even a addon which can do that?

share|improve this question

closed as not a real question by bybe, John Conde May 10 '13 at 20:39

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Have you already committed to area51.stackexchange.com/proposals/34294/… –  Marcel May 10 '13 at 14:09
add comment

1 Answer 1

From the Joomla! online documentation:

To override the system error results, copy the templates/system/error.php file into your templates/ directory. If it finds one, Joomla! will use the error.php file from the current template, in place of the system file. You can format the page, as desired, to match your template.

So add something like the following to your template's error.php:

<?php if ($this->error->code == '403') : ?>
    <div id="errorboxheader">Not Allowed</div>
        <div id="errorboxbody"><p>Sorry! You are not authorized to view this resource. Please login or register.</p>
        <!-- Copy the code of the login module here! -->
        </div>
    </div>
<?php endif; ?>
share|improve this answer
    
I tried this but it doesn't seem to work, is it maybe because my joomla front-end is using a german language extension? –  elhombre May 20 '13 at 12:33
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.