The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Changing Navigation-link names with Javascript question for phpbb2

View previous topic View next topic Go down

Solved Changing Navigation-link names with Javascript question for phpbb2

Post by TonnyKamper on 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?
avatar
TonnyKamper
Forumember

Female Posts : 135
Reputation : 11
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

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

Post by SLGray on 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.


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40897
Reputation : 2776
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

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

Post by TonnyKamper on 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
avatar
TonnyKamper
Forumember

Female Posts : 135
Reputation : 11
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

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

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

Semicolon = ;


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40897
Reputation : 2776
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

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

Post by TonnyKamper on 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');
});
avatar
TonnyKamper
Forumember

Female Posts : 135
Reputation : 11
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

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

Post by SLGray on 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');
  });


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40897
Reputation : 2776
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

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

Post by TonnyKamper on 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
avatar
TonnyKamper
Forumember

Female Posts : 135
Reputation : 11
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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');
  });
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2064
Reputation : 314
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 on 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:
avatar
TonnyKamper
Forumember

Female Posts : 135
Reputation : 11
Language : Dutch/English
Location : The Netherlands

http://test-tube.actieforum.com/

Back to top Go down

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

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

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


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1846
Reputation : 230
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

View previous topic View next topic Back to top


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