Forthcoming events

August
September
October
November
December
View calendar

Newsletters

General News & Information
Please register to the site before you can sign for a list.
No account yet? Register

Latest Articles

Log In

Users Online Now

None

Welcome to Joomla User Group Suffolk

Home Hints and Tips Joomla How to redirect "You need to Log In" to a content article
How to redirect "You need to Log In" to a content article

Sometimes you might have the situation where you would rather have an informational piece of text to advise the user that they need to register to view the content article or so forth, rather than have them dumped to the "You need to log in to view this" page.  Here's how!

You need to edit a couple of files to do this:

/includes/application.php

/components/com_contact/views/contact/view.html.php

/components/com_content/views/article/view.html.php

If you search for the phrase "base64_encode" you'll find the following lines:

$url  = 'index.php?option=com_user&view=login';
$url .= '&return='.base64_encode($return);;

This generates the ugly long url's and dumps you at the login page.

simply replace this with:

$url  = 'index.php?option=com_content&task=view&id=<idnumberofarticletobeshown>';

You can find the article ID by going to the Article Manager section, and looking at the ID column which will give you a number!