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 Sun 20 Aug - 1:31

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
Forumember

Female Posts : 975
Reputation : 77
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 Sun 20 Aug - 1:59

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 : 51172
Reputation : 3507
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 Sun 20 Aug - 2:05

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
Forumember

Female Posts : 975
Reputation : 77
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 Sun 20 Aug - 2:17

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 : 51172
Reputation : 3507
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 Sun 20 Aug - 2:27

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
Forumember

Female Posts : 975
Reputation : 77
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 Sun 20 Aug - 2:34

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 : 51172
Reputation : 3507
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 Sun 20 Aug - 2:47

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
Forumember

Female Posts : 975
Reputation : 77
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_ Sun 20 Aug - 6:29

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 : 2106
Reputation : 333
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 Sun 20 Aug - 14:38

_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
Forumember

Female Posts : 975
Reputation : 77
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 Sun 20 Aug - 15:31

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