Jump to content

Can i export a theme with module configuration settings?


Recommended Posts

Can we export a theme with default module configuration?

I know we can export a theme using "Import/export a theme" module but that creates a config.xml file  defining positions and status of modules information, but i want to set default configuration settings for those modules.

for example on theme installation/activation for home slider module i want to set width:1000px

 

Any help?

 

Thanks in advance.

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

change module file: homeslider.php code

public function install()
	{
		/* Adds Module */
		if (parent::install() && $this->registerHook('displayHome') && $this->registerHook('actionShopDataDuplication'))
		{
			/* Sets up configuration */
			$res = Configuration::updateValue('HOMESLIDER_WIDTH', '535');
			$res &= Configuration::updateValue('HOMESLIDER_HEIGHT', '300');
			$res &= Configuration::updateValue('HOMESLIDER_SPEED', '500');
			$res &= Configuration::updateValue('HOMESLIDER_PAUSE', '3000');
			$res &= Configuration::updateValue('HOMESLIDER_LOOP', '1');
Link to comment
Share on other sites

Thankyou for response.

I know that we can export modules with our own custom code but i don't want to export default modules with my theme export. Correct me if i am wrong, instead of modifying the code of module can we set default module configuration to our custom configuration like we define module positions and assigned hook in config.xml or any other better way you can suggest.

Link to comment
Share on other sites

Thankyou for response.

I know that we can export modules with our own custom code but i don't want to export default modules with my theme export. Correct me if i am wrong, instead of modifying the code of module can we set default module configuration to our custom configuration like we define module positions and assigned hook in config.xml or any other better way you can suggest.

unfortunately there is no possibility to define "configuration" settings. Exactly as ibndawood mentioned "Config.xml will help you only to install, enable/disable and configure the positions"

Link to comment
Share on other sites

  • 6 months later...

I made my own theme. Exported it in Prestashop 1.6... When I`m install it to clean prestashop - all is good, but content of modules does not change.

For example I need to replaces the standard images of Home slider module when install the theme. How can I do this?

Same thing with other modules such as content of CMS info block, and bannersof Theme Configurator.

I tried to copy the required modules directly from the modules folder, and past them with a complete replacement to new clean prestashop modules folder - but they remain the standard content.

Please tell me how I can move content and settings of modules from my presta to other?

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

Thanks for reply. 

I understand that the export / import database hosting solves this problem. But it fits, if I transfer my own website for example, to another hosting. But I want to put a theme to hundreds of people could install it by yourself. And of course, I can not upload the database. 

 

There is another way to include my custom images in the installation package?

Link to comment
Share on other sites

  • 4 months later...

Can we export a theme with default module configuration?

I know we can export a theme using "Import/export a theme" module but that creates a config.xml file  defining positions and status of modules information, but i want to set default configuration settings for those modules.

for example on theme installation/activation for home slider module i want to set width:1000px

 

Any help?

 

Thanks in advance.

 

The best way to do it, is to create your own module, which do one of the following things:

 

1. The module, do PHP insert database strings to set needed configurations, this is harder but you can avoid DB prefix problems.

2. The module do SQL dump insert into the database making needed configurations, however i'm not aware if you can make SQL dump to recognise DB prefixes, so if the prefix is not the default "PS_" this won't work.

Link to comment
Share on other sites

×
×
  • Create New...