Securehotel Web Services

  • Increase font size
  • Default font size
  • Decrease font size

Latest Refurbs

Bristol Estate Community

Care CoOps

Safetynet in Whitehawk and Manor Frarm.

YMCA/Princes Trust (Hove)

 

Vulnerable Extensions

How to redirect "You need to Log In" to a content article

E-mail Print PDF

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.