Jump to content

how to add new link/block in navigation bar


Recommended Posts

open this file:

themes/default-bootstrap/modules/blockcontact/nav.tpl

 

add there code:

<div  class="header_user_info">
	<a href="{$link->getPageLink('index', true)|escape:'html':'UTF-8'}" title="{l s='Home' mod='blockcontact'}">{l s='Home' mod='blockcontact'}</a>
</div>
<div class="header_user_info">
	<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>
</div>

effect

iKLTQPW.png

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

open this file:

themes/default-bootstrap/modules/blockcontact/nav.tpl

 

add there code:

<div  class="header_user_info">
	<a href="{$link->getPageLink('index', true)|escape:'html':'UTF-8'}" title="{l s='Home' mod='blockcontact'}">{l s='Home' mod='blockcontact'}</a>
</div>
<div class="header_user_info">
	<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>
</div>

effect

iKLTQPW.png

 

Hi vekia,
 
Do you know the code to insert "Sitemap" link in the nav bar together wiht "About us", "Contact us"...?
 
Thanks in advance.
Link to comment
Share on other sites

 

Hi vekia,
 
Do you know the code to insert "Sitemap" link in the nav bar together wiht "About us", "Contact us"...?
 
Thanks in advance.

 

 

just use:

 

<div class="header_user_info">
<a href="{$link->getPageLink('sitemap')|escape:'html':'UTF-8'}" title="{l s='Sitemap' mod='blockcontact'}">
{l s='Sitemap' mod='blockcontact'}
</a>
</div>
  • Like 2
Link to comment
Share on other sites

 

just use:

 

<div class="header_user_info">
<a href="{$link->getPageLink('sitemap')|escape:'html':'UTF-8'}" title="{l s='Sitemap' mod='blockcontact'}">
{l s='Sitemap' mod='blockcontact'}
</a>
</div>

 

 

Thanks vekia, it's working!!!

Link to comment
Share on other sites

  • 4 months later...
  • 4 months later...
  • 1 month later...

Hello i used this code 

<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>

But it's not translating to the default site language. Can anyone help me please?

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

open this file:

themes/default-bootstrap/modules/blockcontact/nav.tpl

 

add there code:

<div  class="header_user_info">
	<a href="{$link->getPageLink('index', true)|escape:'html':'UTF-8'}" title="{l s='Home' mod='blockcontact'}">{l s='Home' mod='blockcontact'}</a>
</div>
<div class="header_user_info">
	<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>
</div>

effect

iKLTQPW.png

 

how can add custom URL ? for example google.com

 

Thanks

Chris

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...

Hi,

 

I face the same problem here but seems that your solution doesn't affect my page. I tried to edit the themes/default-bootstrap/modules/nav.tpl with the code you suggested Vekia but nothing happened.

 

Do you have any suggestion why this happened? If you need I can provide you links and permissions to  take a look.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I face the same problem here but seems that your solution doesn't affect my page. I tried to edit the themes/default-bootstrap/modules/nav.tpl with the code you suggested Vekia but nothing happened.

 

Do you have any suggestion why this happened? If you need I can provide you links and permissions to  take a look.

Try my solution..

 

!important: Locate temp file (cache) (search for it via totalcmd) and backup it. Searh for some kind of unique html tag in your code. 
         Turn on Force compile and make sure you have turned down Cache underneath Force compile..
edit nav.tpl following file and upload it back. 
/themes/default-bootstrap/modules/blockcontact/nav.tpl
 
Refresh your shiny websites.. Better?
Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...
Hello, I also have two small questions. I added the code below but:

1. I try to add "About us" before  "Contact us" in both languages, RO and EN. The code was added after Contact us and I need it befor Contact us.

2. I dont know how to put the Romanian translation.

 

So the code looks like this (the website is www.soromania.com). Where do I do wrong? Thank you in advance.

 


<div class="header_user_info">

<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>

</div>

 

<div id="contact-link" {if isset($is_logged) && $is_logged} class="is_logged"{/if}>

<a href="{$link->getPageLink('contact', true)|escape:'html':'UTF-8'}" title="{l s='Contact us' mod='blockcontact'}">{l s='Contact us' mod='blockcontact'}</a>

</div>

{if $telnumber}

<span class="shop-phone{if isset($is_logged) && $is_logged} is_logged{/if}">

<i class="icon-phone"></i>{l s='Call us now:' mod='blockcontact'} <strong>{$telnumber}</strong>

</span>

{/if}


 

 


 

Link to comment
Share on other sites

  • 1 month later...

 

 

2. I dont know how to put the Romanian translation.

 

I've created a custom CMS page in 2 languages.

 

This solution works but indeed pulls the same title (for both languages), which is indicated in this part:

 

 

{l s='My Custom Page' mod='blockcontact'}</a>

 

How do you have this work for the other language?

 

Thanks!

Link to comment
Share on other sites

Hi ALEXCNX,

 

go to "Localization"  -->  "Translations".

 

In the area "MODIFY TRANSLATIONS":

->> Type of translation: Select "Installed modules translations"

->> Select your theme

->> Select the language you want to modify the translations

and seach by My Custom Page or the title you want to translate.

 

Regards.

 

Goyo.

Link to comment
Share on other sites

  • 3 months later...

That works perfectly, thanks. The problem is, when i open the site on mobile and i login, the default "contact us" line doesn't appaer anymore. Instead, i correctly see the custom line. The problem appaers only when logged in. Looks like the lenght of the username hides the line at the extreme left. Site and screenshot.

Requesting help, let me know guys ^_^

Ok, found the css of that one, i fixed it, but looks awful on mobile. Any advice about how i could edit it to appaer better on mobile? Thanks in advance.

 

Edit:

nevermind, i think i fixed it forcing the float to the right on the css on the resolution exceptions for mobile. I even showed up the telephone number now. Better than nothing :) Now, it's possible to add a little space after the number?

 

Edit2:

removed for now, i just aligned to the right the phone number. Very useful thread tho, thanks.

Edited by Nandos (see edit history)
Link to comment
Share on other sites

As suggested in another thread, I installed the module

HTMLbox

 

and got the same solution, although I do like updating code when possibly. Only problem with that is I've updated so many .tpl files that I'm sure I can't update Prestashop or I'd lose everything - correct??

Link to comment
Share on other sites

  • 7 months later...

Please help me. I'm new in prestashop. I want to add "Seller Panel" in my prestashop 1.6 navigation bar. Thanks

Tried:

/themes/default-bootstrap/modules/blockcontact/nav.tpl

<div  class="header_user_info">
    <a rel="external" href="http://www.seller.manufacturerbox.com">{l s='Seller Panel' mod='blockcontact'}</a>
</div>

 

not working

please help

thanks in advance

 

 

Edited by akbsandy7
notifiaction (see edit history)
Link to comment
Share on other sites

  • 4 months later...

As I stated above, all the suggestions the admins offered do not work. You need to install a module called HTMLbox in order to update the topmost menu:

Modules and Services / htmlbox

 

NOTE: This is for PS 1.6.x. I have not yet completely used the latest version so updating could possibly be different as I am seeing there are many updates to V1.7

 

themes/default-bootstrap/modules/blockcontact/nav.tpl

or

themes/yourtheme/modules/blockcontact/nav.tpl

 

NONE OF THESE WORK

Link to comment
Share on other sites

  • 1 year later...
On 4/21/2014 at 3:17 AM, vekia said:

open this file:

themes/default-bootstrap/modules/blockcontact/nav.tpl

 

add there code:


<div  class="header_user_info">
	<a href="{$link->getPageLink('index', true)|escape:'html':'UTF-8'}" title="{l s='Home' mod='blockcontact'}">{l s='Home' mod='blockcontact'}</a>
</div>
<div class="header_user_info">
	<a href="{$link->getCmsLink('4')|escape:'html':'UTF-8'}" title="{l s='About us' mod='blockcontact'}">{l s='About us' mod='blockcontact'}</a>
</div>

effect

iKLTQPW.pngi tried this but failed. I cant open my website after i added this code.Please help me

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...