PHPackages                             flowpack/neos-dimensionresolver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. flowpack/neos-dimensionresolver

ActiveNeos-package

flowpack/neos-dimensionresolver
===============================

A support package for Neos CMS that allows for arbitrary content dimension resolution.

2.2.0(1y ago)710.0k↓42.7%10[3 PRs](https://github.com/Flowpack/neos-dimensionresolver/pulls)GPL-3.0+PHP

Since Jan 14Pushed 6mo ago12 watchersCompare

[ Source](https://github.com/Flowpack/neos-dimensionresolver)[ Packagist](https://packagist.org/packages/flowpack/neos-dimensionresolver)[ RSS](/packages/flowpack-neos-dimensionresolver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

Flowpack Neos Content Dimension Resolver
========================================

[](#flowpack-neos-content-dimension-resolver)

**Hint: for Neos 9, this behavior is mostly implemented in the Core, and  implements the remaining domain-based behavior**

Introduction
------------

[](#introduction)

For a general overview over content dimension, please refer to the respective sections in the Neos manual.

This package enhances the default capabilities of detecting and linking to dimension presets by providing both new features and extension points.

### Installation

[](#installation)

```
composer require flowpack/neos-dimensionresolver
```

### Dimension Configuration

[](#dimension-configuration)

The available dimensions and presets can be configured via settings:

```
Neos:
  ContentRepository:
    contentDimensions:

      # Content dimension "language" serves for translation of content into different languages. Its value specifies
      # the language or language variant by means of a locale.
      'language':
        # The default dimension that is applied when creating nodes without specifying a dimension
        default: 'mul_ZZ'
        # The default preset to use if no URI segment was given when resolving languages in the router
        defaultPreset: 'all'
        label: 'Language'
        icon: 'icon-language'
        presets:
          'all':
            label: 'All languages'
            values: ['mul_ZZ']
            resolutionValue: 'all'
          # Example for additional languages:

          'en_GB':
            label: 'English (Great Britain)'
            values: ['en_GB', 'en_ZZ', 'mul_ZZ']
            resolutionValue: 'gb'
          'de':
            label: 'German (Germany)'
            values: ['de_DE', 'de_ZZ', 'mul_ZZ']
            resolutionValue: 'de'
```

**Note:**The `uriSegment` configuration option provided by default via Neos is still supported but disencouraged.

### Preset resolution

[](#preset-resolution)

Using this package, content dimension presets can be resolved in different ways additional to the "classic" way of using an URI path segment. Thus further configuration and implementation options have been added.

The dimension resolver comes with three basic `resolution modes` which can be combined arbitrarily and configured individually.

### URI path segment based resolution

[](#uri-path-segment-based-resolution)

The default resolution mode is `uriPathSegment`. As by default in previous versions, it operates on an additional path segment, e.g. `https://domain.tld/{language}_{market}/home.html`. These are the configuration options available:

```
Neos:
  ContentRepository:
    contentDimensions:
      'market':
        resolution:
          mode: 'uriPathSegment'
          options:
            # The offset defines the dimension's position in the path segment. Offset 1 means this is the second part.
            # This allows for market being the second uriPath part although it's the primary dimension.
            offset: 1
      'language':
        resolution:
          mode: 'uriPathSegment'
          options:
            # Offset 0 means this is the first part.
            offset: 0
Flowpack:
  Neos:
    DimensionResolver:
      contentDimensions:
       resolution:
         # Delimiter to separate values if multiple dimension are present
         uriPathSegmentDelimiter: '-'
```

With the given configuration, URIs will be resolved like `domain.tld/{language}-{market}/home.html`

**Note:**An arbitrary number of dimensions can be resolved via uriPathSegment. The other way around, as long as no content dimensions resolved via uriPathSegment are defined, URIs will not contain any prefix.

The default preset can have an empty `resolutionValue` value. The following example will lead to URLs that do not contain `en` if the `en_US` preset is active, but will show the `resolutionValue` for other languages that are defined as well:

```
Neos:
  ContentRepository:
    contentDimensions:

      'language':
        label: 'Language'
        icon: 'icon-language'
        default: 'en_US'
        defaultPreset: 'en_US'
        resolution:
          mode: 'uriPathSegment'
        presets:
          'en_US':
            label: 'English (US)'
            values: ['en_US']
            resolutionValue: ''
```

The only limitation is that all resolution values must be unique across all dimensions that are resolved via uriPathSegment. If you need non-unique resolution values, you can switch support for non-empty dimensions off:

```
Neos:
  Neos:
    routing:
      supportEmptySegmentForDimensions: false
```

### Subdomain based resolution

[](#subdomain-based-resolution)

Another resolution mode is `subdomain`. This mode extracts information from the first part of the host and adds it respectively when generating URIs.

```
Neos:
  ContentRepository:
    contentDimensions:
      'language':
        default: 'en'
        defaultPreset: 'en'
        resolution:
          mode: 'subdomain'
          options:
            # true means that if no preset can be detected, the default one will be used.
            # Also when rendering new links, no subdomain will be added for the default preset
            allowEmptyValue: true
        presets:
          'en_GB':
            label: 'English'
            values: ['en']
            resolutionValue: 'en'
          'de':
            label: 'German (Germany)'
            values: ['de_DE']
            resolutionValue: 'de'
```

With the given configuration, URIs will be resolved like `{language}.domain.tld/home.html`

**Note:**Only one dimension can be resolved via subdomain.

### Top level domain based resolution

[](#top-level-domain-based-resolution)

The final resolution mode is `topLevelDomain`. This modes extracts information from the last part of the host and adds it respectively when generating URIs.

```
Neos:
  ContentRepository:
    contentDimensions:
      'market':
        default: 'eu'
        defaultPreset: 'eu'
        resolution:
          mode: 'topLevelDomain'
        presets:
          'EU':
            label: 'European Union'
            values: ['EU']
            resolutionValue: 'eu'
          'GB':
            label: 'Great Britain'
            values: ['GB']
            resolutionValue: 'co.uk'
          'DE':
            label: 'Germany'
            values: ['DE', 'EU']
            resolutionValue: 'de'
```

With the given configuration, URIs will be resolved like `domain.{market}/home.html`

**Note:**Only one dimension can be resolved via top level domain.

### Custom resolution

[](#custom-resolution)

There are planned extension points in place to support custom implementations in case the basic ones do not suffice.

#### Defining custom resolution components

[](#defining-custom-resolution-components)

Each resolution mode is defined by two components: An implementation of `Neos\Neos\Http\ContentDimensionDetection\ContentDimensionPresetDetectorInterface`to extract the preset from an HTTP request and an implementation of `Neos\Neos\Http\ContentDimensionLinking\ContentDimensionPresetLinkProcessorInterface`for post processing links matching the given dimension presets.

These can be implemented and configured individually per dimension:

```
Neos:
  ContentRepository:
    contentDimensions:
      weather:
        detectionComponent:
          implementationClassName: 'My\Package\Http\ContentDimensionDetection\WeatherDimensionPresetDetector'
        linkProcessorComponent:
          implementationClassName: 'My\Package\Http\ContentDimensionLinking\WeatherDimensionPresetLinkProcessor'
```

If your custom preset resolution components do not affect the URI, you can use the `Flowpack\Neos\DimensionResolver\Http\ContentDimensionLinking\NullDimensionPresetLinkProcessor`implementation as the link processor.

**Note:**

If you want to replace implementations of one of the basic resolution modes, you can do it this way, too.

#### Completely replacing resolution behaviour

[](#completely-replacing-resolution-behaviour)

The described configuration and extension points assume that all dimension presets can be resolved independently. There may be more complex situations though, where the resolution of one dimension depends on the result of the resolution of another. As an example, think of a subdomain (language) and top level domain (market) based scenario where you want to support `domain.fr`, `domain.de`, `de.domain.ch`, `fr.domain.ch` and `it.domain.ch`. Although you can define the subdomain as optional, the default language depends on the market: `domain.de` should be resolved to default language `de` and `domain.fr`should be resolved to default language `fr`. Those complex scenarios are better served using individual implementations than complex configuration efforts.

To enable developers to deal with this in a nice way, there are predefined ways to deal with both detection and link processing.

Detection is done via an HTTP middleware that can be replaced via configuration:

```
Neos:
  Flow:
    http:
      middlewares:
        detectContentSubgraph:
          middleware: Flowpack\Neos\DimensionResolver\Http\DetectContentSubgraphMiddleware
```

Link processing is done by the `Flowpack\Neos\DimensionResolver\Http\ContentSubgraphUriProcessorInterface`. To introduce your custom behaviour, implement the interface and declare it in `Objects.yaml` as usual in Flow.

**Note:**Please refer to the default implementations for further hints and ideas on how to implement resolution.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance53

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~399 days

Recently: every ~424 days

Total

6

Last Release

685d ago

Major Versions

1.1.1 → 2.02021-03-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/25d49a6af82b72d2764774a05c307808375016d7aeaaef3862472a6580ff38a7?d=identicon)[flowpack](/maintainers/flowpack)

---

Top Contributors

[![kdambekalns](https://avatars.githubusercontent.com/u/95873?v=4)](https://github.com/kdambekalns "kdambekalns (10 commits)")[![MarcoPNS](https://avatars.githubusercontent.com/u/35105681?v=4)](https://github.com/MarcoPNS "MarcoPNS (4 commits)")[![batabana](https://avatars.githubusercontent.com/u/36864084?v=4)](https://github.com/batabana "batabana (3 commits)")[![skurfuerst](https://avatars.githubusercontent.com/u/190777?v=4)](https://github.com/skurfuerst "skurfuerst (2 commits)")[![kitsunet](https://avatars.githubusercontent.com/u/324408?v=4)](https://github.com/kitsunet "kitsunet (2 commits)")[![crydotsnake](https://avatars.githubusercontent.com/u/39345336?v=4)](https://github.com/crydotsnake "crydotsnake (1 commits)")[![mficzel](https://avatars.githubusercontent.com/u/1309380?v=4)](https://github.com/mficzel "mficzel (1 commits)")[![nezaniel](https://avatars.githubusercontent.com/u/1687674?v=4)](https://github.com/nezaniel "nezaniel (1 commits)")[![albe](https://avatars.githubusercontent.com/u/4259532?v=4)](https://github.com/albe "albe (1 commits)")

### Embed Badge

![Health badge](/badges/flowpack-neos-dimensionresolver/health.svg)

```
[![Health](https://phpackages.com/badges/flowpack-neos-dimensionresolver/health.svg)](https://phpackages.com/packages/flowpack-neos-dimensionresolver)
```

###  Alternatives

[neos/neos-ui

Neos CMS UI written in React

2661.0M104](/packages/neos-neos-ui)[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

116989.0k674](/packages/neos-neos)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.0M27](/packages/neos-eel)[flowpack/searchplugin

Plugin for search integration via content node

24257.5k1](/packages/flowpack-searchplugin)[neos/form-builder

Flow Form Framework integration into Neos CMS

19347.1k18](/packages/neos-form-builder)[neos/media

The Media package

101.1M45](/packages/neos-media)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
