[SOLVED] How to extend existing Site Package

Hey, i would like to extend a Site Package what would be my base site and create additional packages where i just overwrite some settings to use this solution for multi-domain and multi language: Multiple host with different languages - #4 by BoxerBuffa

In which file do i have to reference the base package and how is this done?

Hi Finn

Extending a Site package means creating an additional package with an own Composer manifest that requires your base package.

The general approach is described here. First, you create a package My.Site.Base (my/site-base) within your folder DistributionPackages. I suggest to use neos-package (and not neos-site) as type so your base package doesn’t show up as a possible Site in the backend.

Then, you create another package My.Site.Foo (my/site-foo) of type neos-site. This package requires "my/site-base": "*" in its composer.json.

Then, in your Root composer.json, you require your "my/site-foo": "@dev" package as described in the link above.

Now, when you run composer update, the loading order will be correct: Your my/site-foo will depend on my/site-base which means that you can override Fusion code.

Please keep in mind that all YAML configuration is global, i.e. if you add an additional NodeType configuration in just one site, it will be available globally. Use constraints to make sure the proper NodeTypes are available for the proper site.

If you need to override certain Settings or NodeType configuration, you can use the SiteSpecifics package. Be aware that this package depends on the siteName, not on the node type, i.e. if in the Neos backend your site is named “My awesome site”, this will be the name to use for SiteSpecifics to work.

1 Like

Hey Lorenz,
thanks for your detailed description, I will give it a try!

Please keep in mind that all YAML configuration is global, i.e. if you add an additional NodeType configuration in just one site, it will be available globally. Use constraints to make sure the proper NodeTypes are available for the proper site.

If you need to override certain Settings or NodeType configuration, you can use the SiteSpecifics package . Be aware that this package depends on the siteName, not on the node type, i.e. if in the Neos backend your site is named “My awesome site”, this will be the name to use for SiteSpecifics to work.

If I get this right, I cant overwrite yaml settings by just adding the yaml to the site package.

What I struggle with is the language configuration. Would like to set the uriSegment and default language for every Site package individual.

Edit: Looks like i can do it with Neos 9? That would be awsome!
https://docs.neos.io/guide/advanced/site-configuration

Yes, with Neos 9 this will be easier.

In the meantime, would this package help you with your requirements?

1 Like

Hey Lorenz,
thats exactly what i need and it works like a charm!

Thank you very mutch!