title: Joomla 2.5 - Visible Menu Item - but need login to access
body: <p>I followed this tutorial about ACL - <a href="http://community.joomla.org/blogs/community/1252-16-acl.html" rel="nofollow">http://community.joomla.org/blogs/community/1252-16-acl.html</a></p>
  
  <p>To make everything clear: this is what I need:</p>
  
  <ol>
  <li>having a menu item that is linking to an article</li>
  <li>a user enters (not logged yet) the web site (it does not matter if the user is already registered or not)</li>
  <li>this user should see the menu item</li>
  <li>the user clicks on the menu item</li>
  <li><ul>
  <li>if the user is NOT logged in - the user is asked to enter the username/pass</li>
  <li>if the user is logged in -> goto 6</li>
  </ul></li>
  <li>after login is ok, the user can see the content of the article where the menu item was linked.</li>
  </ol>
  
  <p>My aim is to have a menu item that would be visible for all users: logged in and not logged in. But when clicked - only logged in users can view the content where the menu item is pointing. In case the user is not logged in -> log in form should be displayed.</p>
  
  <p>After following the above tutorial I got a menu item that is completely invisible for users that are NOT logged in.</p>
  
  <p>How can I make the menu item to be visible for all, but need login to see content?</p>
  
  <p>Thank you.</p>
  
  <p>EDIT 1:</p>
  
  <p>I just found this solution <a href="http://docs.joomla.org/Auto_redirect_guests_to_login" rel="nofollow">http://docs.joomla.org/Auto_redirect_guests_to_login</a>
  Is it the only solution? I have a huge tree menu structure. That means I need to have a clone of my huge menu... And everytime I change a menu item name - I should do it twice (in visible menu and in invisible menu).
  Are there any other solutions without having 2 menus?</p>
  
  <p>EDIT 2:</p>
  
  <p>Found another solution (hacking core files).
  This is when menu item is set to "public" but the article ACL is set to "registered"</p>
  
  <p>components/com_content/views/article/view.html.php</p>
  
  <p>from</p>
  
  <pre><code>// Check the view access to the article (the model has already computed the values).
  if ($item-&gt;params-&gt;get('access-view') != true &amp;&amp; (($item-&gt;params-&gt;get('show_noauth') != true &amp;&amp;  $user-&gt;get('guest') ))) {
    JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
    return;
  }
  </code></pre>
  
  <p>to</p>
  
  <pre><code>// Check the view access to the article (the model has already computed the values).
  if ($item-&gt;params-&gt;get('access-view') != true &amp;&amp; (($item-&gt;params-&gt;get('show_noauth') != true &amp;&amp;  $user-&gt;get('guest') ))) {
    // Redirect to login
    $uri = JFactory::getURI();
    $app-&gt;redirect('index.php?option=com_users&amp;view=login&amp;return=' . base64_encode($uri), JText::_('Members please login to view this page. If you are not a member please &lt;a href="/component/users/?view=registration"&gt;register here&lt;a&gt;'));
    return;
  }
  </code></pre>
  
  <p>How can I override that code and avoid hacking core files?</p>
  
  <p>Or maybe there is a more elegant solution?</p>
  
  <p>Thanks.</p>