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.
The forum of the forums
4 posters

    Changing Navigation-link names with Javascript question for phpbb2

    TonnyKamper
    TonnyKamper
    Active Poster


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

    Solved Changing Navigation-link names with Javascript question for phpbb2

    Post by TonnyKamper August 20th 2017, 1: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?
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

    Post by SLGray August 20th 2017, 1: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.
    TonnyKamper
    TonnyKamper
    Active Poster


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

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

    Post by TonnyKamper August 20th 2017, 2: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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

    Post by SLGray August 20th 2017, 2: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.
    TonnyKamper
    TonnyKamper
    Active Poster


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

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

    Post by TonnyKamper August 20th 2017, 2: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');
    });
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

    Post by SLGray August 20th 2017, 2: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.
    TonnyKamper
    TonnyKamper
    Active Poster


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

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

    Post by TonnyKamper August 20th 2017, 2: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
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


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

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

    Post by _Twisted_Mods_ August 20th 2017, 6: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');
     Â       });
    TonnyKamper
    TonnyKamper
    Active Poster


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

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

    Post by TonnyKamper August 20th 2017, 2: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:
    Draxion
    Draxion
    Helper
    Helper


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

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

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

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

      Current date/time is September 22nd 2024, 2:41 pm