The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Changing Navigation-link names with Javascript question for phpbb2

4 posters

Go down

Solved Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper August 20th 2017, 12:31 am

Hi dear Forumotioners,

I am trying to rename navigationlinks, because in my language the translation made them too long/wide after a thorough search I found a script and was able to figure out how to make it work for my navbar, it helped me rename the "Je hebt geen nieuwe berichten" (You have no new messages) to a simple "Mailbox" see below code:

Code:
$(function(){
  $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox');
});

I want a few more links changed, so I tried to add a second JS with another link, but nothing happened, tried several other links but still nothing..
It seems like I can only add that script one time, so my question is can I add more links into that one script? And if so how can I do that?
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1053
Reputation : 78
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by SLGray August 20th 2017, 12:59 am

Try adding a coma before the semicolon and add the links you want.  Just make sure to add a coma between each link code, but not the last one.


Changing Navigation-link names with Javascript question for phpbb2 Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51532
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper August 20th 2017, 1:05 am

SLGray wrote:Try adding a coma before the semicolon and add the links you want.  Just make sure to add a coma between each link code, but not the last one.

Thank you @SLGray On the risk of sounding foolish what's a semicolon exactly? is it : or ; ? because I'm not sure where to put that coma.. Embarassed
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1053
Reputation : 78
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by SLGray August 20th 2017, 1:17 am

Semicolon = ;


Changing Navigation-link names with Javascript question for phpbb2 Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51532
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper August 20th 2017, 1:27 am

SLGray wrote:Semicolon = ;

Ah thank you very much @SLGray would it look something like this then?

Code:
$(function(){
  $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox'),;
a.mainmenu[href*="/memberlist"]').html('Leden'),;
a.mainmenu[href*="/groups"]').html('Groepen');
});
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1053
Reputation : 78
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by SLGray August 20th 2017, 1:34 am

Code:
        $(function(){
          $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox'),
        [href*="/memberlist"]').html('Leden'),
        [href*="/groups"]').html('Groepen');
        });


Changing Navigation-link names with Javascript question for phpbb2 Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51532
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper August 20th 2017, 1:47 am

SLGray wrote:
Code:
        $(function(){
          $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox'),
        [href*="/memberlist"]').html('Leden'),
        [href*="/groups"]').html('Groepen');
        });

Thank you very much @SLGray but it did nothing, it even changed the first link back to what it was before.. blackeye
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1053
Reputation : 78
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by _Twisted_Mods_ August 20th 2017, 5:29 am

Code:
 $(function(){
          $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox'),
        $('a[href*="/memberlist"]').html('Leden');
        $('a[href*="/groups"]').html('Groepen');
        });
_Twisted_Mods_
_Twisted_Mods_
Helper
Helper

Male Posts : 2108
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper August 20th 2017, 1:38 pm

_Twisted_Mods_ wrote:
Code:
 $(function(){
          $('.bodylinewidth .bodyline > table:nth-child(2) a.mainmenu[href*="/privmsg?folder=inbox"]').html('Mailbox'),
        $('a[href*="/memberlist"]').html('Leden');
        $('a[href*="/groups"]').html('Groepen');
        });

Wow @_Twisted_Mods_ that worked like a charm, just awesome ! :party: Yes Clap
Thank you so much for your help and time :rose:
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1053
Reputation : 78
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Changing Navigation-link names with Javascript question for phpbb2

Post by Draxion August 20th 2017, 2:31 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum