Forums / General Questions / Defining new links in menu bar

Defining new links in menu bar

Views: 782

Results 1 to 5 of 5
21 Oct 2011, 1:21 PM
#1
stood avatar

stood

New Zenner

Join Date:
Sep 2010
Location:
crewe
Posts:
41
Plugin Contributions:
0

Defining new links in menu bar

Hello, I added some html links to the menu bar, but now I need them in different language as well. I installed Serbian language pack, but I still have my links in the top menu in English. I decided to define the links in PHP, so I went to includes/languages/english/classic/header.php and added stuff like
define('HEADER_TITLE_ABOUT' , 'About us'); instead the html so that I could easily switch between English and Serbian,
but when I add it to tpl_header.php as a link it shows only the "HEADER_TITLE_ABOUT" rather than "about us". The same problem occurs when it comes to Serbian version. Has anyone got a clue what to do about it?
Kind regards

21 Oct 2011, 11:04 PM
#3
kidtwist avatar

kidtwist

New Zenner

Join Date:
May 2009
Posts:
30
Plugin Contributions:
0

Re: Defining new links in menu bar

this is how i did it. hope it helps

includes>languages>your template>english.php

// top navigation menu text
  define('TOP_MENU_BP', 'Barnett Performance');
  define('TOP_MENU_STORE_HOME', 'Store Home');
  define('TOP_MENU_MAIN_SITE', 'T&J Main Page');
  define('TOP_MENU_NEW_PRODUCTS', 'New Products');
  define('TOP_MENU_SPECIALS', 'Specials');
  define('TOP_MENU_VIEW_CART', 'View Cart');
  define('TOP_MENU_MY_ACCOUNT', 'My Account');

includes>templates>your template>common>tpl_top_nav.php

<?php
if ($current_page_base == 'T&J_Main_Page') {	$active	= 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="http://www.tandjperformance.com"><?php echo TOP_MENU_MAIN_SITE;?></a></li>
        
        <?php
if ($current_page_base == 'T&J_Store_Home') {	$active	= 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="http://www.tandjperformance.com/store"><?php echo TOP_MENU_STORE_HOME;?></a></li>
        
        <li id="<?php echo $active;?>"><a href="http://www.barnettperformance.net"><?php echo TOP_MENU_BP;?></a></li>
<?php

if ($current_page_base == 'products_new') {	$active	= 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="index.php?main_page=products_new"><?php echo TOP_MENU_NEW_PRODUCTS;?></a></li>

<?php
if ($current_page_base == 'specials') { $active = 'tab_active'; 
	} else { $active = '';
}?>
		<li id="<?php echo $active;?>"><a href="index.php?main_page=specials"><?php echo TOP_MENU_SPECIALS;?></a></li>

my zens
tandjperformance.com - socaloffroad.net - barnettperformance.net - vintageoctane.com

25 Oct 2011, 10:22 PM
#4
stood avatar

stood

New Zenner

Join Date:
Sep 2010
Location:
crewe
Posts:
41
Plugin Contributions:
0

Re: Defining new links in menu bar

Hi,
I defined the link in different file (english.php and serbian.php in languages) and than used that definitions in tpl_header.php and now everything is fine. I must have used a wrong file previously.
Thanks a lot :)