Jump to content
dmuchamad

how to add new link/block in navigation bar

Recommended Posts

Please help me. I'm new in prestashop. I want to add "Home", "About Us" in my prestashop 1.6 navigation bar. Thanks.

 

post-779065-0-60354200-1398014979_thumb.jpg

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

i don't understand, sorry

you mean that you want to translate these fields? 

 

sorry for my misunderstanding once again

  • Like 1

Share this post


Link to post
Share on other sites

Sorry about my bad English.

 

Solved.

 

Using Inside the BO : LOCALISATION | Traductions.

 

Writing the missing translated fields and all is fine now.

 

Thanks vekia

Edited by myselfidem (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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!!!

Share this post


Link to post
Share on other sites

re the above salution if i wanted to add an external link to that menu what would be the code to enter ?
 thanks in advance.

Share this post


Link to post
Share on other sites

You can use something like this:

 

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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}


 

 


 

Share this post


Link to post
Share on other sites

 

 

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Awesome! I couldn't find it as it was hidden under DEFAULT-BOOTSTRAP - NAV.

 

Thanks much, Goyo!  :)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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??

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Hi, I would like to add the email shop in DisplayNav1. I have tried editing Nav.tpl but I don´t know the code to show the email of the shop (I am working in a multistore PS 1.7.4.4, so I cant write the email as text because every shop has a diferent email). Thanks
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More