0

I'm using a secondary template for a new menu, which requires a login. I created a login module assigned to a position on that template and the new menu. The template is assigned to the new menu and no other template is assigned to that menu. Users first land on one of the new menu pages from offsite links.

When a user is not logged in, the login module associated with the menu and template should display. However, the default login module is displayed with the default template.

How can I force the display of the secondary's template's login module?

1

I assume that when you say new menu, you mean a new menu item.

If I have understood right what you have done, you have assigned the second template and the login module on that one new menu item that requires login, for which -I also assume- you have set its access level to a non public level, which most likely that would be Registered.


See what happens now with the above setup:

  • Someone needs to be already logged-in into your site, in order to reach at your new menu item and see whatever it has to display.
  • Joomla following your setup will have first to ask the user to login, so it will redirect him to the Login page of the users component. Certainly that page won't be that new menu item that you have created and that you have assigned your login module and the second template - as this is restricted for non-logged in users, plus it isn't recognized as a standard login page, because Joomla doesn't know and doesn't even care about what modules you have published on that page.

*You may think that that page would act and be considered as the login page, because you published a module, but Joomla base this on the components and/or menu items.

Solutions

In order to achieve what you want, you need to have 2 separate pages with your second template assigned:

  • One for the login page set to public access level - that will be of the type com_users -> login. So Joomla will load this page/menu item when redirecting someone for login.
  • The other one with the restricted content that you have now.

Having said that, may I question your purpose and final goal?
Are you sure that what you need is really a registered/members only area on the website, or what you actually need is a page with password-protected content?

  • I mean both a new menu and new menu item. The access level to the login module and login menu item is Public. The purpose is to put pages in iframes on offsite pages. – steveorg Mar 3 at 15:29
  • @steveorg: In the solutions I propose above, I had to edit a bit the first step. The first page must be a menu item of the com_users->login type. – FFrewin Mar 3 at 17:25
  • The login menu type is Users -> Login Form. Everything else seems to match your solution, including 4 menu items for restricted content. After login, the correct template displays. – steveorg Mar 3 at 20:50
  • @steveorg: I am not sure I understand your comment. Do you mean you it's ok now? – FFrewin Mar 3 at 22:39
  • I wish. I'm just saying that your solution matches what I've done. However, the wrong template still displays for the login module. – steveorg Mar 4 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.