Jump to content

Need to change categories block title?


itzbilly

Recommended Posts

Hi, I'm having trouble changing the title of my categories block on 1.6. I've searched the forums and it looks like the solution is to change the tpl directly or to change the translations in backoffice. I've tried both and had no luck. I've also tried changing it so it doesn't show the {l s='categories' bit of code and just typed in Shop by Category. I've tried both clearing the cache through backoffice and by flushing the DNS cache with my host. No good. Anybody have any clue as to what's going on? This is a fairly stock install and no major changes were made to any files (mostly just CSS).

Link to comment
Share on other sites

Go to yourprestashop/yourtheme/lang/en.php > Search for "categories" coincidence.

Have always in mind that you should disable any kind of cache in Advanced Parameters > Performance to any change to be visible.

 

Hi, all of my cache is turned off but I cleared it just in case. No good. As for the en.php, this is what I found in there that has categories:

$_LANG['cms_d3c42ceb9bee8c44815b53f36e496925'] = 'List of subcategories in %s:';
$_LANG['sitemap_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categories';

Neither one seems to be what I should be looking for?

Link to comment
Share on other sites

Yes, I was wrong. Prestashop is like a puzzle, sometimes it is  a bit hard to find the correct route to a file. My excuses!

 

go to /yourtheme/modules/blockcategories/translations/en.php

 

If nothing changes,then check the same route but outside yourtheme:

 

/yourprestashop/modules/blockcategories/translations/en.php

Edited by nutxlago (see edit history)
  • Like 1
Link to comment
Share on other sites

it is very simple to change text for categories

 

bo-->localization-->translations-->front office translations-->select language-->select modify

 

here I usually toggle close/open all so I can see all xlations

 

now use ctl-F to get browser search box, then find what you are wanting to change...change it...file it...done

 

tip: never change directly xlatioin files..or .tpl files...it is never required to change any text...

Link to comment
Share on other sites

Yes, I was wrong. Prestashop is like a puzzle, sometimes it is  a bit hard to find the correct route to a file. My excuses!

 

go to /yourtheme/modules/blockcategories/translations/en.php

 

If nothing changes,then check the same route but outside yourtheme:

 

/yourprestashop/modules/blockcategories/translations/en.php

 

Hi, thanks for your solution! While it didn't directly solve my issue, I ended up editing the tpl that was in yourtheme/modules/blockcategories. I didn't even think about checking there for a template for blockcategories.

 

I'm having the same problem because this module, depending in which categorie you are, it changes its title to the actual categorie. I would like to keep always the title to "Products" (and "Productos" in Spanish, etc ...).

 

Thx you very much.

 

Try the solution I described just above!

  • Like 1
Link to comment
Share on other sites

I guess I found the code I have to modify:

<h2 class="title_block">
	#{if isset($currentCategory)}
	#	{$currentCategory->name|escape}
	#{else}
		{l s='Categories' mod='blockcategories'}
	#{/if}
</h2>

I guess just removing the lines of code with an # at the begining would stick the name to "s='Categories'", but I'm not sure how to modify / translate this string. I searched in the standard tool in prestashop to translate but there's no place for blocks to be translated, so I guess it has to be done inside the en.php (es.php, etc ...) in the "/yourprestashop/modules/blockcategories/translations/", and can't be done exclusively for a theme, but that's ok.

 

The problem inside this php files is that I can not understand what to translate / modify because I can not find the string 'Categories':

$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categories';

I understand in this line that 'Categories' is the translation itself, but I don't know if that is the string "name" also.

 

Thx for the help.

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

  • 2 weeks later...

I guess I found the code I have to modify:

<h2 class="title_block">
	#{if isset($currentCategory)}
	#	{$currentCategory->name|escape}
	#{else}
		{l s='Categories' mod='blockcategories'}
	#{/if}
</h2>

I guess just removing the lines of code with an # at the begining would stick the name to "s='Categories'", but I'm not sure how to modify / translate this string. I searched in the standard tool in prestashop to translate but there's no place for blocks to be translated, so I guess it has to be done inside the en.php (es.php, etc ...) in the "/yourprestashop/modules/blockcategories/translations/", and can't be done exclusively for a theme, but that's ok.

 

The problem inside this php files is that I can not understand what to translate / modify because I can not find the string 'Categories':

$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categories';

I understand in this line that 'Categories' is the translation itself, but I don't know if that is the string "name" also.

 

Thx for the help.

 

go to /yourtheme/modules/blockcategories/blockcategories.tpl

 

and look for this line of code:

 

<h4 class="title_block">{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}</h4>

 

and replace for this line of code:

 

<h4 class="title_block">{l s='Categories' mod='blockcategories'}</h4>

 

Then change the word Categories for anything you want.

Link to comment
Share on other sites

  • 3 months later...

Great, it works!

http://totallighting.eu/5-led-svietidla

 

{if $blockCategTree && $blockCategTree.children|@count}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
<h2 class="title_block">
{l s='Categories' mod='blockcategories'}
</h2>
<div class="block_content">
<ul class="tree {if $isDhtml}dhtml{/if}">
{foreach from=$blockCategTree.children item=child name=blockCategTree}
{if $smarty.foreach.blockCategTree.last}
{include file="$branche_tpl_path" node=$child last='true'}
{else}
{include file="$branche_tpl_path" node=$child}
{/if}
{/foreach}
</ul>
</div>
</div>
<!-- /Block categories module -->
{/if}
Link to comment
Share on other sites

×
×
  • Create New...