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.

Change nav bar text

View previous topic View next topic Go down

Solved Change nav bar text

Post by Nekobake on July 23rd 2015, 2:51 am

ehem hello <3

i wanna change the "you have no new messages" part to "no new messeges" (and "new messages" for the other case). i thought it would be in one of the templates????? but it's not???? idek im new to forumotion skinning ehem ehem.

Nekobake
New Member

Posts : 16
Reputation : 1
Language : English - Greek
Location : in yo pants

http://nekonogomidampu.forummotion.com/

Back to top Go down

Solved Re: Change nav bar text

Post by Nekobake on July 31st 2015, 12:16 pm

bump???

Nekobake
New Member

Posts : 16
Reputation : 1
Language : English - Greek
Location : in yo pants

http://nekonogomidampu.forummotion.com/

Back to top Go down

Solved Re: Change nav bar text

Post by Taiwan Dive Sites on July 31st 2015, 1:08 pm

Well, it looks like I'm not the only one wanting to do the exact same thing.

Please advise.

Thanks

Taiwan Dive Sites
Forumember

Posts : 31
Reputation : 1
Language : English

http://taiwandivesites.greatestboard.com/

Back to top Go down

Solved Re: Change nav bar text

Post by Russel on July 31st 2015, 2:58 pm

Hi,

You may change the menu name of navigation texts using javascript codes management.

1. Navigate to Admin Panel > Modules > HTML & Javascript, choose Javascript codes management. Make sure to Enable the Javascript codes management to Yes.
2. Create a new javascript
3. Add your own title and check the Placement: 'In all the pages'
4. Copy and paste this code:
Code:
$(function(){
$('a.mainmenu:contains("You have no new messages")').text('Inbox');
$('a.mainmenu:contains("You have 1 new message")').text('Hey, You have New PM!');
});
5. Save

You can change the texts 'Inbox' 'Hey, You have New PM!' to whatever texts you want.

Russel
Active Poster

Male Posts : 1400
Reputation : 235
Language : English, Filipino
Location : Philippines

http://help.forumotion.com/forum

Back to top Go down

Solved Re: Change nav bar text

Post by Ange Tuteur on July 31st 2015, 3:11 pm

The only problem with the jQuery contains() selector is that the replacement will only work if the text matches that exactly. So if you have more than 1 PM or you're using a different language, that replacement is not going to work.

I'd recommend something along these lines :
Code:
$(function() {
  var lang = {
        no_message : 'No new messages',
        new_message : 'New messages'
      },
      pm = document.getElementById('i_icon_mini_message'),
      pm_new = document.getElementById('i_icon_mini_new_message');
 
  if (pm) pm.parentNode.innerHTML = lang.no_message;
  if (pm_new) pm_new.parentNode.innerHTML = lang.new_message;
});

Check the image node for existence and then change the parent's HTML. For ease of use, you can modify the texts inside the lang object. HTML can be used in the text for color, images, etc..

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change nav bar text

Post by Nekobake on August 5th 2015, 8:53 pm

thank you both :>

my problem's solved <33

Nekobake
New Member

Posts : 16
Reputation : 1
Language : English - Greek
Location : in yo pants

http://nekonogomidampu.forummotion.com/

Back to top Go down

Solved Re: Change nav bar text

Post by SLGray on August 6th 2015, 4:53 am

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 36641
Reputation : 2441
Language : English
Location : United States

http://ztwds.forumotion.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