Themes_Repository Folder

Hi… this is a cut and paste from another thread after I realised I posted it in the wrong section:



Hi there,



I am moving from v3 to v4 and in the process of moving my themes across. I get it that if I want to create a new theme, I just clone the directory in /design/themes and make the relevant changes.



However can somone explain the purpose of the /var/themes_repository folder? When does this folder get used? Is it just a location to store your theme for restoration at a later date?



More information please and thankyou!! :)

[quote name=‘natewallis’ timestamp=‘1427754904’ post=‘209618’]

Hi… this is a cut and paste from another thread after I realised I posted it in the wrong section:



Hi there,



I am moving from v3 to v4 and in the process of moving my themes across. I get it that if I want to create a new theme, I just clone the directory in /design/themes and make the relevant changes.



However can somone explain the purpose of the /var/themes_repository folder? When does this folder get used? Is it just a location to store your theme for restoration at a later date?



More information please and thankyou!! :)

[/quote]



This folder contains all existing themes of your store. It is location, where you can keep all themes you want and install necessary ones to work folder (design/themes/). Also, an add-ons templates are copied to work dir from theme repository.



Best regards,

CS-Market

Ok, thanks…



If I add a theme to /var/themes_repository it doesn't become available to install in the CS-CART backend. Should it?



it only becomes available once it is in the design folder, which is fine, but it goes against the methodology that was used in v3 which is why I am trying to get my head around it.

[quote name='natewallis' timestamp='1427760775' post='209628']

Ok, thanks…



If I add a theme to /var/themes_repository it doesn't become available to install in the CS-CART backend. Should it?



it only becomes available once it is in the design folder, which is fine, but it goes against the methodology that was used in v3 which is why I am trying to get my head around it.

[/quote]



If you place the theme in var/themes_repository, it becomes available to install in the backend. After the installation (copying theme files from var/themes_repository to design/themes/) theme becomes available to use.



Best regards,

CS-Market.

Also if you uninstall the theme or any addon, the corresponding files will be deleted from design/themes, but not from var/themes_repository

Just following up on this - that all makes sense...

One concern I have is a suitable workflow here to make sure that all customisations are kept.

For example, if I install a new theme, make custom changes in the /design/theme_name folder using addon hooks etc.. then the design folder is now more valuable than the themes_repository folder.

If the theme was to be uninstalled and then reinstalled, none of those custom changes would be kept right?

It would be nice if a theme is active and changes are made that it syncs back to the theme_repository? Anyone have a workflow for this? I guess you could write a small script to do so...


For example, if I install a new theme, make custom changes in the /design/theme_name folder using addon hooks etc.. then the design folder is now more valuable than the themes_repository folder.

If the theme was to be uninstalled and then reinstalled, none of those custom changes would be kept right?

You have probably figured all this out by now - but you made a very valuable point that nobody responded to, so I will.

For the reason that you mention, I make all my custom add on changes in the var/theme_repository area so that they are never lost on an uninstall. That means I need to reinstall to make them active - but it is the safest place to put those custom changes. It is a bit weird having your definitive source code residing in a var subdirectory - but that is the safest way I have found to work. I would be interested in any alternative work flows.

You have probably figured all this out by now - but you made a very valuable point that nobody responded to, so I will.

For the reason that you mention, I make all my custom add on changes in the var/theme_repository area so that they are never lost on an uninstall. That means I need to reinstall to make them active - but it is the safest place to put those custom changes. It is a bit weird having your definitive source code residing in a var subdirectory - but that is the safest way I have found to work. I would be interested in any alternative work flows.

As alternative, you can set the DEVELOPMENT constant to true (in config.php). In this case, templates will also not be deleted on uninstall

Use the My changes add-on. This is an add-on that can override whole files, or hooks, which is the point of this add-on, so everything will remain the same and any core changes are made via the My Changes add-on. Read about it and it will make more sense. The repository folder is kind of like the backup that is later used to restore add ons that you uninstall, and later reinstall; allowing such action, without deleting the add-on and also not in your live theme folder.

Hope this helps although a late reply.