Jump to content
TNG Community

Remove Login button from navigation bar - Solved


Rob Severijns

Recommended Posts

Rob Severijns

My homepage (index.php) contains information about living people and therefor every sitevisitor is automaticly redirected to the loginpage (login.php)

I made some changes to the loginpage in order to share some extra info for non-logged in visitors.

Since the loginpage already contains a Login button on the page itself, I was wondering if there is a way to remove the login button on the navigationbar.

I have two reasons for this:

1 - There is no need to have two login buttons on the same page

2 - The changes I made to the loginpage don't fit in the popup that shows when the Login button is clicked on the to navigation bar (See image)

I'm using template 260 by GWT but is has the same top navigation bar as in template 19 & 21

The intention is that after a visitor is logged in, the Logout button on the top navigation bar is visible so visitors can actualy logout.

 

image.png

Link to comment
Share on other sites

Rob,   Could you post a snippet of where there are 2 login links on those templates?  I looked at T19, but don't see what you are asking.  You don't want the 'login' link in the top menu, but want the logout there when logged out, which is confusing to me.

Ron

Link to comment
Share on other sites

Rob Severijns

Hi Ron,

Thx for replying.

If you go to my website The Severijns / Timmer Family you will notice you are automaticly redirected to the login.php.

You will find a login button (Aanmelden) on the top navigation bar and a login button at the bottom of the page.

Clicking the top login button opens a popup that doesn't fit the dimensions of the login page.

That's basicly why I don't want to see the login button in the top navigation bar when a visitor isn't logged in.

In such a case the visitor can only use the login button on the bottom of the page and no popup will appear.

After login, the login button in the top navigation bar will turn into a logout button. 

This is normal behaviour and should be kept that way.

So not logged in = No login button in top navigation bar and after login via the login button on the bottom of the page the logout button is visible in the top navigation bar.

Hope this helps.

 

image.png

Link to comment
Share on other sites

Template 19 doesn't doesn't take visitors to the login screen, so no multiples in my testing.  But you could try these changes in genlib.php:

Find this line: roughly line 684 or so, depending on other mods installed touching genlib.php.

                $left_icons .= tng_smallIcon(array('label'=>$text['login'], 'id'=>"log", 'onclick'=>"return openLogin('{$login_url}p=" . urlencode($cms['tngpath']) . "');"));
 

Change to:

                $nolog = "";
                $left_icons .= tng_smallIcon(array('label'=>$nolog, 'id'=>"log", 'onclick'=>"return openLogin('{$login_url}p=" . urlencode($cms['tngpath']) . "');"));
 

Which essentially removes the login label from the navigation menu.  If one logs in, the logout should appear, but if you logout, the login disappears.

Didn't do much testing, and as I said, I couldn't see the multiple logins.

Ron

Link to comment
Share on other sites

Rob Severijns

Found the solution based on your advice.

I commented out the line:

               // $left_icons .= tng_smallIcon(array('label'=>$text['login'], 'id'=>"log", 'onclick'=>"return openLogin('{$login_url}p=" . urlencode($cms['tngpath']) . "');"));

and now the login button is gone.

Logout button appears after login

Thx Ron :-)

 

Edited by Rob Severijns
Thanking Ron
Link to comment
Share on other sites

  • Rob Severijns changed the title to Remove Login button from navigation bar - Solved

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...