prestashop 1.6 theme customization by module - prestashop-1.6

I usually buy themes at ThemeForest for prestashop, and I want receive updates for themes. But sometimes i need modify couple .tpl from theme.
I found in documentation the "file structure" of a module. And exist a folder called /themes/[theme_name]/modules. It is used for "Sub-folder for overriding .tpl files and languages files, if necessary." It looks like only for override modules inside of theme.
My Question:There are any way of override the .tpl of theme root folder using a module?.
This way I updated theme from themeforest without problems and after i can reinstall my module for customization of theme.
My Solution by now: The only way I found, and I do not like, is to create another copy of a theme. but then not be able to receive updates of theme

You can't override a theme for now. This functionality will be introduced in Prestashop 1.7 currently in development.
If you create a new module you will not be able to override default template files defined by the core. Or you'll have to override core controllers to use your templates then you'll lose core updates.
The simplest way to do so for now is to copy the theme and after each updates check for changes and report those changes into your copy...

Florian's answer is absolutely correct and until PS 1.7 certainly the recommended way to go.
I Just wanted to throw in that, if your changes are likely to be far fewer than those of theme updates, it could be worthwhile to create modified templates, say product_mod.tpl, and then override the initContent() function in the controller to show your modified template. You would then only need to compare the changes for the files you modified.
But, this would only be worthwhile if your modifications are much fewer than the changes in theme updates.

Related

CN1 - unable to use localization after activating css

Recently I switched over from the legacy css integration to using the current method of css support via the CN1 Preferences dialog. Ever since then, I've had repeated problems accessing strings from the localization resource file.
A few important points:
I have two theme files, but even importing the strings as a csv file into the theme generated by css doesn't work
I've tried all possible combinations of theme initialization with the two theme files, including initializing just one of them, with no consistent success (occasionally it works, but then if I modify the css and the theme file gets regenerated it stops working again)
I created a brand new project and copied my code into it, imported the string files, and it worked - until I turned on css support. Then I was back to square one
When it fails to work, the method UIManager.getL10NResourceNames() returns an empty array
Any help would be greatly appreciated!
CSS controls the file and as a result you can no longer change the theme.res file by other means. You need to keep a separate localization.res file and load that strictly for the localization functionality of your application. You can use Resources.open("/localization.res") to load an arbitrary resource file.
After much poking around, I found the solution. It turns out my situation was the result of a few non-standard things I did. First of all, I had a theme.res file which I renamed using IntelliJ's Refactor >> Rename function, which renamed the hardcoded css theme name in the build.xml file to my new name. I needed to manually revert that string in order to prevent the css compile task from overwriting my theme file. The second thing I noticed is that sometimes (I'm not clear on what caused this) the theme file was not being refreshed in the /out directory when running the app locally. This would manifest itself, for instance, when I would add an image in the theme file, but when running the code it wouldn't be able to find it in the Resources hashtable. Every time this happens, I now know to just delete the contents of /out, thereby forcing the IDE to rebuild/recopy the theme file (I could probably just copy it manually to the /out directory, but I think deleting it is safest).

Umbraco Template Layout Transfers

I have one umbraco site with various templates and layouts setup. I will like to transfer the template types and layouts to a new site i am building which tools or scripts can i use to do this. The export document type and import doucment types does not copy all the fields across.
You could use USync or Courier. Usync is free and Courier is free for use on local domains only otherwise you would have to purchase a license. Both of these options involve a learning curve, especially USync.
Your only other option is manually - personally, this is the option I would choose. With templates, I would create the items with exactly the same names in the Umbraco back office first (this looks after the database aspect of template setup) and would set up some blank template files on the file system. Then I would copy across the old template files to overwrite the new blank ones... done!

How do I simply send my rails website to my designer so he can finish the design?

Basically I need to send to my designer a non-finished rails website.
My Designer doesn't have ruby / Rails environnement installed and should be able to:
modify the CSS
add some html elements
I can manually check the diff after he worked.
Is there a way that I can make an easy extraction of my app or giving an access to the deployed one with capacity to re-root the css from his files?
Based on your question, your designer, in addition to the design, also writes code: he creates css files, and edit your views files. That makes him an integrator.
As such, he should learn the basics of source control management, such as git, svn or any system you prefer (my favorite is Bazaar, for its simplicity).
It is a best practice that will allow you to save some time and avoid a lot of headaches when merging your revisions. A nice side effect: he will be able to easily roll-back to a previous working version of the code, should anything bad have happened.

Word 2010 automation with templates

I have written several applications in Delphi which use Word automation. The programs all use templates which are stored in a directory. In pre-2010 versions of Word, one would define the location of the templates in tools|options|file locations; the programs would pass the name of the template and Word would know where to find it.
My client has now moved to Office 2010, and as a result, Word cannot find the template when started by my programs. I haven't been able to find a similar dialog box in Word in which I can define the default directory for templates. How does one define such a directory?
Click File | Options | Advanced | File Locations and you get the same dialog as in older verions
Instead of forcing your user to configure Word to define the location of templates, you might prefer to invoke word using /t switch.
/ttemplatename starts Word with a new document based on a template other than the Normal template.
>"%programfiles%\Microsoft Office\Office14\winword.exe" /t"c:\MYTEMPLATES\mytemplate.dotx"
Can't you just specify the full path when creating a new document? Why rely on a settings that possibly can even be changed by the user? Put your templates in your own folder and specify the full path.
Word's paths configuration are stored
You can get the USER template folder via
Word.Application.Options.DefaultFilePath(WdDefaultFilePath.wdUserTemplatesPath)
(there are others options for that property too).
As far as I can tell, the template loading rules haven't changed from 2007 to 2010.
Generally speaking, if your add in needs to load a template, you should specify the FULL path and file name to the template, but you can get the typical user path via the above.
On the other hand, if you install the template into WORD\STARTUP, word will automatically load it. that may not be what you need/want, though.
Finally, if your template doesn't/shouldn't change, it might be better to leave it in your PROGRAM FILES\appname folder and load it from there.
Generally speaking, +requiring+ users to change the FILE LOCATIONS in word (or changing it programmatically) is a bad idea, just because so many people wouldn't have a clue, and those that do definitely DO NOT want addins changing those settings automatically!

How does theming for ziya charts work?

I'm implementing charts using The Ziya Charts Gem. Unfortunately, the documentation isn't really helpful or I haven't had enough coffee to figure out theming. I know I can set a theme using
chart.add(:theme, 'whatever')
Problem: I haven't found any predefined themes, nor have I found a reference to the required format.
If you install the ZiYa plug-in into your Rails application there should be a themes directory where you said. Just copy one of the existing themes, change its name to whatever you want, and then modify it however you like.
Another options for nice Flash charts is Open Flash Chart. I moved from Ziya/SWF Charts to Open Flash Chart when working on Flash charts in a Rails app I was working on. There is also a Rails plug-in for Open Flash Chart. Besides the fact that it is easier to work with, Open Flash Chart is open source, so if you can hack Flash you can customize it.
As I understand it, the themes are used by initializing the theme directory in your ziya.rb file like so:
Ziya.initialize(:themes_dir => File.join( File.dirname(__FILE__), %w[.. .. public charts themes]) )
And you'll need to set up the proper directory, in this case public/charts/themes. It doesn't come with any in there to start with as I recall. Are you having problems past this?
To partly answer my own question, there are some themes in the website sources which can be checked out at
svn co svn://rubyforge.org/var/svn/liquidrail/samples/charting
(then go to /public/charts/themes/)

Resources