Initial setup of sites with dimensions

IMHO There’s a missing piece for sites using dimensions: there are some nodes like / and /sites that do not need separate variants for all presets. Right now Neos itself doesn’t care about these paths, but tools like the Elasticsearch adapter use the root path for traversing all the nodes and have problems if e.g. /sites is not reachable for a specific preset. So it seems Neos never creates these variants by itself, so the indexing fails for all non-default presets. It can be solved by having a dimension value as a fallback in every preset and assigning that to the /sites node (or by adding variants for all presets) but that’s not completely intuitive and working out of the box.

What are your experiences with these kinds of setup? How did you solve this problem? What should be the best practice we ship with Neos?

Hi @christopher how did you achieve this exactly?

It can be solved by having a dimension value as a fallback in every preset and assigning that to the /sites node (or by adding variants for all presets

I tried values: ['en', '/sites'] - but is that what you mean?

He means to have something like ‘mul_ZZ’ as default and fallback for everything, but I we already discussed a better alternative, that is just not implemented yet.

Thnx for explaining. Any notes on the better alternative somewhere?

For reference - or someone else who is in need of this:

For the setup see: http://neos.readthedocs.org/en/stable/CreatingASite/ContentDimensions.html

Perform these queries:

UPDATE typo3_typo3cr_domain_model_nodedata
SET dimensionvalues='{"language":["mul_ZZ"]}' WHERE path='/sites';

UPDATE typo3_typo3cr_domain_model_nodedata
SET dimensionvalues='' WHERE path='/';

UPDATE typo3_typo3cr_domain_model_nodedata as n
SET n.dimensionshash=md5(n.dimensionvalues) WHERE n.dimensionvalues='{"language":["mul_ZZ"]}';

UPDATE typo3_typo3cr_domain_model_nodedimension as d, typo3_typo3cr_domain_model_nodedata as n
SET d.value='mul_ZZ' WHERE d.nodedata=n.persistence_object_identifier AND n.path='/sites';

Rebuild your nodeindex:

./flow nodeindex:build && ./flow nodeindex:cleanup

Thanks @christianm for your help here :wink: