Site Factory¶
Site Factory is a site management interface, integrated with the Back Office. It enables you to configure new sites without editing YAML-based SiteAccess configuration.
Note
A SiteAccess that you define for a site by following the configuration
is always treated with higher priority than a SiteAccess created by using the Site Factory.
For example, if you define a French site within a YAML file,
and then create a site that uses the fr
path in Site Factory, matchers ignore the second site.
Site Factory is disabled by default after installation.
If you plan to use Site Factory, you need to enable and configure it. To enable or disable Site Factory, follow respectively:
Enable Site Factory¶
To enable Site Factory, set ez_platform_site_factory.enabled
to true
in config/packages/ezplatform_site_factory.yaml
.
Configure designs¶
Next, configure Site Factory by adding empty SiteAccess groups. At least one empty group is required. The number of empty SiteAccess groups must be equal to the number of templates that you want to have when you create the new site.
In this example, you add two SiteAccess groups (example_site_factory_group_1
and example_site_factory_group_2
)
that correspond to the two templates (site1
and site2
) that you add in the next step.
Add the groups in config/packages/ezplatform.yaml
:
1 2 3 4 5 6 7 8 9 10 11 |
|
Uncomment the SiteAccess matcher (EzSystems\EzPlatformSiteFactory\SiteAccessMatcher
):
1 2 3 4 |
|
ezdesign
defines templates for your sites, so add them before continuing.
Next, add the configuration for ezdesign
on the same level as ezplatform
:
1 2 3 4 |
|
Finally, configure designs for empty SiteAccess groups:
1 2 3 4 5 6 |
|
Add site template configuration¶
Add thumbnails and names for your site templates in config/packages/ezplatform_site_factory.yaml
:
1 2 3 4 5 6 7 8 9 10 |
|
You can check the results of your work in the Back Office by going to the Site tab and selecting the List icon.
There, you should be able to add a new site and choose a design for it.
Define domains¶
To be able to see your site online, you need to define a domain for it.
Define domain for production environment
These steps are for dev
environment only.
If you want to define domains in production environment, you will need to configure Apache or Nginx by yourself.
In the .env
file change line 2 to: COMPOSE_FILE=doc/docker/base-dev.yml:doc/docker/multihost.yml
Take a look into the doc/docker/multihost.yml
file. Here you can define domains.
To add a new domain, add it in command:
and under frontend and backend aliases as shown in the example below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Next, you must define the domains in etc/hosts
:
0.0.0.0 site.example.com admin.example.com test.example.com www.admin.example.com
Then, run docker-compose up
:
1 2 |
|
Your sites should be now visible under:
http://site.example.com:8080/
http://admin.example.com:8080/
http://localhost:8080/
http://test.example.com:8080/
Define site directory¶
You can adjust the place where the directory of the new site is created (Location with ID 2 by default).
To do it, go to config/packages/ezplatform_site_factory.yaml
, and add the following parameter:
1 2 3 4 5 |
|
Now, all new directories are created under "Ibexa DXP".
Provide access¶
The Site Factory is set up, now you can provide sufficient permissions to the Users.
Set the below Policies to allow Users to:
site/view
- enter the Site Factory interfacesite/create
- create sitessite/edit
- edit sitessite/change_status
- change status of the public accesses toLive
orOffline
site/delete
- delete sites
For full documentation on how Permissions work and how to set them up, see the Permissions section.
To learn how to use Site Factory, see User documentation.
Disable Site Factory¶
Enabled Site Factory may cause following performance issues:
- ConfigResolver looks for SiteAccesses in the database
- Site Factory matchers are connected to the database in search for new SiteAccesses
You can disable Site Factory to boost ConfigResolver performance. Keep in mind that with disabled Site Factory you are unable to add new sites or use existing ones.
1. In config/packages/ezplatform_site_factory.yaml
change enabled
to false
.
2. In config/packages/ezplatform.yaml
comment the ezplatform.siteaccess.match: '@EzSystems\EzPlatformSiteFactory\SiteAccessMatcher': ~
if it is uncommented.
3. Remove separate connection to database in config/packages/doctrine.yaml
.
1 2 3 4 5 6 |
|
4. Remove separate cache pool in config/packages/cache.yaml
.
1 2 3 4 5 6 |
|
The Site Factory should be disabled.