This module has been deprecated as part of Zikula 4 slimming diet.
The Multisites module.
Please check the 1.x branch for the version for Zikula 1.x!
The Multisites module allows to create and use a huge number of websites for arbitrary purposes and clients. Beside normal "main" sites you can also run other relevant pages, like for example for multiple retail stores, sales partners or landing pages for specific topics.
It is possible to manage any number of projects for multiple clients. Each project can thereby contain any number of sites. By using site templates you can easily reuse structure, content as well as layouts and functionality across multiple sites.
This module is intended for being used with Zikula 2.0.15+.
The Multisites module is installed like this:
modules/
into the modules/
directory of your Zikula installation. Afterwards you should have two folder named modules/Zikula/MultisitesModule/
and modules/Zikula/SubsiteModule/
.Resources/userdata/ZikulaMultisitesModule/
to /web/uploads/ZikulaMultisitesModule/
.
Note this step is optional as the install process can create these folders, too./web/uploads/ZikulaMultisitesModule/
writable including all sub folders.Note the Multisites module should only be installed and activated at the main page. This repository also contains a second module, ZikulaSubsiteModule
, which is required to be enabled for all sites except the main page.
The upgrade process from 1.0.x to 2.0.0 and from 2.0.0 to 2.1.0 has been implemented. It has not been tested throughly yet though (please report your experience).
Also when updating to 2.1.0 you need to manually update app/config/dynamic/generated.yml
and adjust the Multisites properties following the values in your old /config/mutisites_config.php
. The old configuration files are not used anymore, because the whole /config
directory is gone in Zikula 2.x.
When entering the Multisites administration area you will be redirected to a configuration wizard automatically.
When a site is initially created the database is filled with the assigned template's data. After that the CMS delivers this site as soon as it gets called by the configured domain.
During the site creation all parameters are replaced using their deposited values. This approach makes the initialisation process repeatable.
To duplicate an already created site you can use the corresponding database as a basis for a new site template. This new template can then be used for creating further sites, like described above.
To amend a site template change the site which was used to create the template initially. Edit the site's structure and content until it meets your requirements. Afterwards the database is exported again and the resulting sql file is uploaded again into the site template.
Site templates can be copied to change them and store them with a new name. Site parameter definitions are considered and included during the copy process.
It is possible to reapply a site template which has been updated before to all sites based on this template. After approving a confirmation question the initialisation process is performed again for all affected sites ("reset"). This includes overriding of existing content, unless specific database tables have been added to the list of table names to be excluded in the template data. You can even use wildcards here, for example you can exclude all Content tables by using "content_*".
It is also possible to decouple selected sites from their template. As soon as the assignment is removed this site is not affected anymore when the template is reapplied, but is independently configured and maintained. If a decoupled site is reassigned to a site template, this template is applied to it's database like described above.
By using template plugins it is possible to represent variants within one layout theme. Therewith you can use a theme for multiple sites. All data, variables and settings can be part of individual logic thereby. This particularly includes the site parameters mentioned above. So if you for example have three sites for different cities can check the content of the city parameter for design-related decisions.
For this reason all parameter values are provided as module variables during the site initialisation process.
Use in code files:
$city = $variableApi->get('ZikulaSubsiteModule', 'parameterValueCity', 'default value');
if ($city == 'Berlin') {
echo '<h2>Hello Berlin</h2>';
}
Use in templates:
{% set city = getModVar('ZikulaSubsiteModule', 'parameterValueCity', 'default value') %}
{% if city == 'Munich' %}
<h2>Hello Munich</h2>
{% endif %}
If you want to report something or help out with further development of the Multisites module please refer to the corresponding GitHub project at https://github.com/zikula-modules/Multisites.