Jump to content

edit the language bloc (hook h="displayNav")


daniel54986

Recommended Posts

Hello,

 

I'm a new user in prestashop 1.6, i am trying to edit the html structure of the language bloc selector.

 

I have already located the bloc. There is in header.tpl:

<nav>{hook h="displayNav"}</nav>

I just want to edit the generated "DisplayNav" code but i can't find the file displayNav.tpl.

 

 

The displayNav generate this code:

<nav><!-- Block languages module -->
	<div class="languages-block" id="languages-block-top">
		<div class="current">
			<span>Français</span>
		</div>
		<ul class="languages-block_ul toogle_content" id="first-languages" style="display: none;">
			<li class="selected">
				<span>Français</span>
			</li>
			<li>
				<a title="Deutsch (German)" href="http://127.0.0.1/XXX/de/">
					<span>Deutsch</span>
				</a>
			</li>
			<li>
				<a title="Nederlands (Dutch)" href="http://127.0.0.1/XXX/nl/">
					<span>Nederlands</span>
				</a>
			</li>
		</ul>
	</div>
	<!-- /Block languages module -->
</nav>

thank you for your help

Link to comment
Share on other sites

Hi and welcome to the forum.

 

First part of code shows hook named displayNav, and hook are place where you attach code from modules.

So there is no tpl file for hooks. 

Check http://doc.prestashop.com/display/PS16/Managing+Hooks.

 

But what you what to edit is module blocklanguages and its tpl file that is "hooked" there.

https://github.com/PrestaShop/PrestaShop/blob/1.6/themes/default-bootstrap/modules/blocklanguages/blocklanguages.tpl

is tpl file for  module in default theme, so if you use another find file in similar path.

Link to comment
Share on other sites

thank you razaro ! it works!

 

Just another think, how can i found witch module is associated with this hooks ?

 

Because it was easy in this case, but if the module send only "Hello World", how can i found the location of the TPL file ?

 

 

ps: sorry for my english

Link to comment
Share on other sites

You can check in back office in Modules > Positions.

 

There is a list of all hooks and modules that are associated with each hook.

 

Then when you find out what module is hooked should be easy to find which tpl file gives the code.

 

Look into modules  main php file and search for function that have hookDisplayNav in name.

Link to comment
Share on other sites

By default you do have 4 modules in that hook and 4 tpl files :

 

blockcontact - use nav.tpl file to disaplay code in that hook

blockuserinfo - also use its own nav.tpl while

blocklanguages and blockcurrencies use same module name tpl files.

 

And I am not sure why you say only one is generated. If you have only one currency module is hidden.

Also possible that theme hides them.

Link to comment
Share on other sites

×
×
  • Create New...