Articles

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!

 

Sponsors & Supporters

Up-coming events

June JUGS Meeting
14-06-2012 7:30 pm
Category:  User group meetings

Forum posts

Latest Tweets

Joomla! Suffolk Looking forward to meetthemembers tomorrow - are you coming? issba ipswich networking book here http://t.co/9Juc7Ln4
Tuesday, 15 May 2012 14:30
Follow joomlasuffolk on Twitter

Newsletter signup

Sign up to receive meeting notifications, and other useful information!

Go to top