Following is what is happening.
The way K2 is designed I don't think they have designed to have a menu item in main menu in public to submit content directly. So when K2 checks for permission and user is not logged in it redirects to login page in component view.
What I suggest you do is following.
Make your "Blog" menu to show only to registered users in joomla menu item so to see that menu item they have to login first so clicking on it will not trigger permission problem as long as you have also put those users to bloggers user group and they have permission to add content to bloggers category.
Otherwise we can edit following file so it works the way you want it. However obviously this is a general edit so other files will also show this page directly rather then component view.
File: components/com_k2/helpers/permissions.php
Lines: 144 and 148, we need to remove "&tmpl=component" part from below codes.
Original:
Line 144 :
- Code: Select all
$mainframe->redirect('index.php?option=com_user&view=login&return='.$return.'&tmpl=component', JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
Line 148:
- Code: Select all
$mainframe->redirect('index.php?option=com_users&view=login&return='.$return.'&tmpl=component', JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
With removed
Line 144:
- Code: Select all
$mainframe->redirect('index.php?option=com_user&view=login&return='.$return.'', JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
Line 148:
- Code: Select all
$mainframe->redirect('index.php?option=com_users&view=login&return='.$return.'', JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
Also note when creating menu item > K2 Item edit form, on right you will see it automatically assigns Target Windows > New window, which forces the link to open in new window.
We can remove that part with javascript but let me know what you want to do first.
See you around...