Mobile app version of vmapp.org
Login or Join
Murray155

: Customize no access error message 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

@Murray155

Posted in: #Joomla

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

1 Comments

Sorted by latest first Latest Oldest Best

 

@Welton855

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; ?>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme