I will briefly explain the case...
I have a site where I use a Main Menu to browse through the different topics. I want all the menu items to be visible however when the user clicks on them he should be asked to login. When leaving the menu items public it had no effect since you can acess i.e. a category list layout even if all the articles are marked as registered.
In a few words I created an identical menu with all the menu items defined as menu alias to the original ones. Indeed when you click to the public alias menu items pointing to the original registered ones then a login form appears!!
Here comes the tricky part, I have community builder installed and use the cb_login module, however the form that appears corresponds to the joomla login module. In order to use the cb module I edited the includes/application.php file changing line 325 from $url='index.php?option=com_users&view=login'; to $url='index.php/component/comprofiler/login';. This also actually worked but eventually led to my final problem...When I log in I'm being redirect to the Homepage instead of the exact page I was trying to access.When for example try to reach the registered menu item index.php/download I'm being redirected to index.php/component/comprofiler/login/download and when I log in straight to the domain homepage (not even index.php)
Let me also note that with the original joomla login module the redirection works fine but I don't want to use both of these modules.
I'm really sorry for this huge post but I'm open even to a completely different implementation, any idea is valuable