How to Remove the Login and Sign Up options from main menu

Discussion in 'Subrion Open Source CMS Core' started by Helang_IT, Mar 6, 2017.

  1. Helang_IT

    Helang_IT New Member

    I'd like to remove both the Login and Sign Up options from the main menu when members are not logged in.

    As the members feature will be for staff members only I do not want site visitors given the option to login or register. I have provided a discrete link to the login page in the bottom menu without a register option.

    I have modified the login.tpl to remove the register button and I have also disabled the register page.

    I am happy for the staff menu to appear on the main menu when a staff member is logged in, but I do not want the Login and Sign Up options to be displayed on the main menu when no one is logged in.

    Many thanks in advance for your further guidance on this.
  2. Vasily_B.

    Vasily_B. Project Manager

  3. Helang_IT

    Helang_IT New Member

    No this is different... If I modify the render template as per those instructions, I add the following:

    Code (Text):
        {ia_menu menus=$menu.contents class="nav navbar-nav navbar-right nav-mainmenu {$menu.classname}" loginout=true}
    If present, the "loginout=true" code will cause a second login and registration menu to appear next to the one I want to delete. It best to remove "loginout=true" but it does not get rid of the Log In and Sign Up menu items.

    upload_2017-3-7_6-20-14.png <--- WITHOUT loginout=true

    upload_2017-3-7_6-24-0.png <---- WITH loginout=true

    Any other thoughts?

    Regards

    Attached Files:

  4. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

    I think you need to add back loginout=true and instead remove Login and Registration from menu itself in admin panel (menu config). That should solve your issue.
  5. Helang_IT

    Helang_IT New Member

    Unfortunately these options do not appear in the menu config:

    upload_2017-3-7_10-39-6.png

    The Login and Sign Up options ONLY appear when System > Members are activated.

    upload_2017-3-7_10-40-33.png
    If Members functionality is off, then Log In and Sign Up disappear.... but then no one can login on the login menu.

    I basically need the Members functionality ON but WITHOUT the Log In and Sign Up menu items on the main menu. (I can live with the Log In if I must, but I REALLY need to get rid of "Sign Up", because the Sign Up page is disabled and takes visitors to a 404 not found. All members should be controlled by admin.)
  6. Helang_IT

    Helang_IT New Member

    @Gleb_S. Sorry to raise this with you again. Do you have any further thoughts on this issue? I have revoked permissions for Guests to enter the "Registration" page, so they will get a 403 (Forbidden) error. Unlike normal pages, the menu item does not disappear when permissions are revoked.

    I'd like to remove this if possible, but I can't find the code that enables this menu item.
  7. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

    Hello @Helang_IT !

    Here is what I suggest:
    1. Leave permissions as is.
    2. Open up this file: [root]/templates/kickstart/render-menu.tpl
    3. Find line 24 and delete it or comment it like this:

    Code (Text):
    {*<li{if 'member_registration' == $core.page.name} class="active"{/if}><a href="{$smarty.const.IA_URL}registration/">{lang key='register'}</a></li>*}
    4. Open this file: [root]/templates/kickstart/login.tpl and delete or comment line 31 (this will remove registration link on login page)

    That is it.
    If you have further questions, please ask them here.

    Thanks.
    Helang_IT likes this.
  8. Helang_IT

    Helang_IT New Member

    Brilliant! Does the job.

    Thanks again @Gleb_S.
  9. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

  10. tmuhlhausen

    tmuhlhausen New Member

    Also used this Info. Thanks

Share This Page