Show create content menu item to ananymous users but call URL for login/register popup on click I thought it would be simple to do, but after lots of searching I couldn't find exact solution for it. 

So the issue is, I have 2-3 main menu items which I have to show to anonymous users but have to call a URL(for login/register popup) &amp; prompt for login or register if they click on them.

Best solution I found for create content link "node/add/node-type" was something like --

function THEME_preprocess_page(&amp;$vars, $hook) {
    global $user;
    # if url starts with "add" and current user is anonymous
    if (arg(1) === 'add' &amp;&amp; $user-&gt;uid === 0) {
          # redirect to login page
          drupal_goto('user/login');
          exit;
    }
}


It didn't work &amp; it says - "$base_path has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer."

This is a very important functionality thing &amp; I don't know how people resolve it. Can I get any suggestion for it ?
I had the same problem, and solved it without coding. 


Manually set the menu path with absolute URL, ie. http://yourdomain.com/node/add/node-type
Install and enable the module r4032login‎
Done!