Jump to content

Change module's template code only for my theme?


Recommended Posts

Hi,

I’m in the process of changing the default theme to match my current layout. Everything is going ok but I’ve hit one problem, and I wanted to fix it the correct way.

I’m using the search module, and inside the search module’s directory it has the template file blocksearch.tpl. I want to change this tpl file, however if I change it in the /modules/blocksearch directory it will be changed for all installed themes. Is there a way I can change it just for my theme?

Thanks
Andrew

P.S I’ve only just started playing with PrestaShop, and it looks awesome. My only concerns with it are its young age and lack of documentation. I’m sure both of those concerns will disappear as the project matures.

Link to comment
Share on other sites

oh, it seems I have answered my own question after looking at the shop's source code.

To change any module's template just create a directory inside your theme which matches the name of the module. So for example if you wanted to change the file
/modules/blocksearch/blocksearch-header.tpl
then you create a file named:
/themes/name/modules/blocksearch/blocksearch-header.tpl

To get my site looking how I want I am having to change quite a few of these module template files.

I hope this helps someone
Andrew

Link to comment
Share on other sites

I noticed not all module template code can be overriden, for example the file category-tree-branch.tpl can't easily be changed.

I filled a bug report about this here: http://www.prestashop.com/bug_tracker/view/257/ and offered some patches which change the PrestaShop php to accommodate such change.

If anyone finds any other module tpl code that they can't change in their theme, then could you leave a message here and I'll look into a way to fix it. Hopefully my efforts will be incorporated into PrestaShop.

thanks
Andrew

Link to comment
Share on other sites

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...