PHPackages                             jvmtech/selective-mixins - 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. jvmtech/selective-mixins

ActiveNeos-package

jvmtech/selective-mixins
========================

Selective mixins for Neos CMS

v3.3.0(1mo ago)37.1k↓14.3%1MITPHP

Since Apr 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jvm-tech/JvMTECH.SelectiveMixins)[ Packagist](https://packagist.org/packages/jvmtech/selective-mixins)[ RSS](/packages/jvmtech-selective-mixins/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (10)Used By (0)

JvMTECH.SelectiveMixins Package for Neos CMS
============================================

[](#jvmtechselectivemixins-package-for-neos-cms)

[![Latest Stable Version](https://camo.githubusercontent.com/c4224033853dcd066ae7edca447d3ccefb23470144991666f43b5c686120a08c/68747470733a2f2f706f7365722e707567782e6f72672f6a766d746563682f73656c6563746976652d6d6978696e732f762f737461626c65)](https://packagist.org/packages/jvmtech/selective-mixins)[![License](https://camo.githubusercontent.com/ad4f6e98705b954c1fac250a6fe0d455017642b8be4c2fb6d15e12e872913ff6/68747470733a2f2f706f7365722e707567782e6f72672f6a766d746563682f73656c6563746976652d6d6978696e732f6c6963656e7365)](https://packagist.org/packages/jvmtech/selective-mixins)

> Create granular, reusable NodeTypes with ease. Best use with Props.Mixins per presentational components.

- **Load mixins multiple times** in the same NodeType

    ➔ *You've ever overwritten properties by choosing a not unique property name? Use our namespaces and ane the properties like what they are.*
- **Choose properties** you'd like to load

    ➔ *You don't need a property? So don't include, not just hide it.*
- **Extend labels** of props and groups recursively

    ➔ *You don't have to repeat the properties label text ever and ever again. Extend it.*
- **Merge groups** to match editor needs

    ➔ *Combine multiple props of multiple mixins for a new purpose? Do it.*

```
# YOU WRITE..

'Vendor:Teaser':
  superTypes:
    'Neos.Neos:Content': true
  options:
    superTypes:
      'Vendor:Props.Link':
        link: true
      'Vendor:Props.Headline':
        headline: true
      'Vendor:Props.Image':
        desktop: true
        mobile: true
    mergeGroups:
      images:
        'Vendor:Props.Image':
          desktop: true
          mobile: true
  ui:
    label: 'Teaser'
    inspector:
      groups:
        images:
          label: 'Images'

# YOU GET..

'Vendor:Teaser':
  superTypes:
    'Neos.Neos:Content': true
  properties:
    linkHref:
      # ...
      ui:
        inspector:
          group: linkLink
    headlineText:
      # ...
    headlineTagName:
      # ...
      ui:
        inspector:
          group: headlineHeadline
    desktopAsset:
      # ...
      ui:
        inspector:
          group: images
    mobileAsset:
      # ...
      ui:
        inspector:
          group: images
  ui:
    label: 'Teaser'
    inspector:
      groups:
        linkLink:
          label: 'Link'
        headlineHeadline:
          label: 'Headline'
        images:
          label: 'Images'
```

Schema
------

[](#schema)

```
# Native usage:
{Vendor:NodeType}:
  superTypes:
    {NodeTypeNameToMixinAsItIs}: true

# Usage with namespaced mixins:
{Vendor:NodeType}:
  options:
    superTypes:
      {NodeTypeNameToCopyFrom}:
        {NamespaceToPasteInto}: true
        {AnotherNamespaceToPasteInto}: true

# Usage with namespaced and selective mixins:
{Vendor:NodeType}:
  options:
    superTypes:
      {NodeTypeNameToCopyFrom}:
        {NamespaceToPasteInto}:
          {PropertyNameToConsider}: true

# Prefix and suffix group label of all namespaced properties:
{Vendor:NodeType}:
  options:
    superTypes:
      {NodeTypeNameToCopyFrom}:
        {NamespaceToPasteInto}: 'Group Prefix %s Suffix'

# Prefix and suffix all property inspector labels:
{Vendor:NodeType}:
  options:
    superTypes:
      {NodeTypeNameToCopyFrom}:
        {NamespaceToPasteInto}:
          '*': 'Label Prefix %s Suffix'

# Override the properties inspector label:
{Vendor:NodeType}:
  options:
    superTypes:
      {NodeTypeNameToCopyFrom}:
        {NamespaceToPasteInto}:
          {PropertyNameToConsider}: 'New Property Label'
          {PropertyNameToConsider}: 'Property Prefix %s Label'

# Merge Inspector Groups:
{Vendor:NodeType}:
  ui:
    inspector:
      groups:
        newGroup:
          label: 'A new Group'
  options:
    mergeGroups:
      {NewGroupName}:
        {NamespaceToInclude}: true
        {AnotherNamespaceToInclude}: true
      {NewGroupName}:
        {Namespace}:
          {GroupNameToInclude}: true
        {AnotherNamespace}:
          {GroupName}:
            {PropertyNameToInclude}: true
```

Example A
---------

[](#example-a)

Create a presentational frontend component:

```
prototype(Vendor:Component.Link) < prototype(Neos.Fusion:Component) {
  text = ''
  link = ''

  renderer = afx`
    {props.text}
  `
}

```

Create a corresponding reusable Props Mixin which reflects the needed Props:

```
'Vendor:Props.Link':
  abstract: true
  superTypes:
    'JvMTECH.SelectiveMixins:Props': true
  ui:
    inspector:
      groups:
        link:
          icon: link
          label: 'Link'
  properties:
    text:
      options:
        preset: 'rte.plaintext'
    link:
      options:
        preset: 'link.default'
      ui:
        inspector:
          group: link
```

And create a matching Props Fusion to load the component specific data:

```
prototype(Vendor:Props.Link) < prototype(JvMTECH.SelectiveMixins:Props) {
  text = JvMTECH.SelectiveMixins:Data.PlainProperty.Text {
    property = 'text'
  }
  link = JvMTECH.SelectiveMixins:Data.PlainProperty.Link {
    property = 'link'
  }
}

```

Now create a Content NodeType where you reuse this Props-Mixin and -Fusion as often as you like - with different namespaces:

```
'Vendor:Content.ThreeLinks':
  superTypes:
    'Neos.Neos:Content': true
  options:
    superTypes:
      'Vendor:Props.Link':
        left: 'Left %s'
        right: 'Right %s'
        bottom:
          link: true
  ui:
    label: 'Three Links'
    inspector:
      groups:
        bottomLink:
          label: 'Bottom Link'
```

```
prototype(Vendor:Content.ThreeLinks) < prototype(Neos.Neos:ContentComponent) {
  left = Vendor:Props.Link {
    namespace = 'left'
    // result: {
    //   text: ...
    //   link: ...
    // }
  }
  right = Vendor:Props.Link {
    namespace = 'right'
    // result: {
    //   text: ...
    //   link: ...
    // }
  }
  bottom = Vendor:Props.Link {
    namespace = 'bottom'
    // result: {
    //   link: ...
    // }
  }

  renderer = afx`

  `
}

```

The generated NodeType will look like:

```
'Vendor:Content.ThreeLinks':
  superTypes:
    'Neos.Neos:Content': true
  ui:
    label: 'Three Links'
    inspector:
      groups:
        leftLink:
          icon: link
          label: 'Left Link'
        rightLink:
          icon: link
          label: 'Right Link'
        bottomLink:
          icon: link
          label: 'Bottom Link'
  properties:
    leftText:
      options:
        preset: 'rte.plaintext'
    leftLink:
      options:
        preset: 'link.default'
      ui:
        inspector:
          group: leftLink
    rightText:
      options:
        preset: 'rte.plaintext'
    rightLink:
      options:
        preset: 'link.default'
      ui:
        inspector:
          group: rightLink
    bottomLink:
      options:
        preset: 'link.default'
      ui:
        inspector:
          group: bottomLink
```

Example B
---------

[](#example-b)

Merging Inspector Groups to recombine Props-Mixins (only works with options.superTypes):

```
'Vendor:Content.Teaser':
  superTypes:
    'Neos.Neos:Content': true
  options:
    superTypes:
      'JvMTECH.Components:Props.Headline':
        headline:
          text: true
          tagName: true
      'JvMTECH.Components:Props.Button':
        button:
          link: true
    mergeGroups:
      teaserGroup:
        headline: true
        button: true
  ui:
    label: 'Teaser'
    inspector:
      groups:
        teaserGroup:
          label: 'Teaser'

```

The generated NodeType will look like:

```
'Vendor:Content.Teaser':
  superTypes:
    'Neos.Neos:Content': true
  ui:
    label: 'Teaser'
    inspector:
      groups:
        teaserGroup:
          label: 'Teaser'
  properties:
    headlineText:
      options:
        preset: 'rte.headline'
      ui:
        inline:
          editorOptions:
            placeholder: 'JvMTECH.Base:Presets:rte.placeholder.short'
    headlineTagName:
      type: string
      defaultValue: 'h2'
      ui:
        label: 'SEO Tag'
        reloadIfChanged: true
        inspector:
          group: 'teaserGroup'
          editor: Neos.Neos/Inspector/Editors/SelectBoxEditor
          editorOptions:
            multiple: false
            allowEmpty: false
            values:
              h2:
                label: 'H2'
              h3:
                label: 'H3'
              h4:
                label: 'H4'
              h5:
                label: 'H5'
              p:
                label: 'p'
    link:
      options:
        preset: 'link.default'
      ui:
        inspector:
          group: 'teaserGroup'
```

Upgrade Instructions
--------------------

[](#upgrade-instructions)

### Neos Compatibility

[](#neos-compatibility)

Neos VersionPackage Version9.x3.x8.x1.x, 2.x### 2.x to 3.x

[](#2x-to-3x)

No Migrations are necessary

### 1.x to 2.x

[](#1x-to-2x)

Since 2.x SelectiveMixins does properly support nested props.

Example:

```
'Vendor:Props.TwoLinks':
  abstract: true
  superTypes:
    'JvMTECH.SelectiveMixins:Props': true
  options:
    superTypes:
      'Vendor:Props.Link':
        linkA: true
        linkB: true
```

```
prototype(Vendor:Props.TwoLinks) < prototype(JvMTECH.SelectiveMixins:Props) {
  linkA = Vendor:Props.Link {
    namespace = 'linkA'
  }
  linkB = Vendor:Props.Link {
    namespace = 'linkB'
  }
}

```

Therefor the fundamental prototype and mixin `JvMTECH.SelectiveMixins:Data` is now used for property loading only, and the new `JvMTECH.SelectiveMixins:Props` is there to create props.

And if you did use nested workarounds with something like `SelectiveMixins.Array.toCamelCase([props.namespace, 'something'])` you now probably just need `'something'` or `SelectiveMixins.Array.toCamelCase([nestedNamespace, 'something'])`.

Tests
-----

[](#tests)

Run the following test in your project to make sure the Selective NodeType generation is still working as expected, even after upgrades:

```
cp DistributionPackages/JvMTECH.SelectiveMixins/Tests/Functional/Fixtures/NodeTypes.yaml DistributionPackages/JvMTECH.SelectiveMixins/Configuration/NodeTypes.Test.yaml;
FLOW_CONTEXT=Testing ./flow flow:cache:flush;
FLOW_CONTEXT=Testing ./bin/phpunit -c ./DistributionPackages/JvMTECH.SelectiveMixins/Tests/PhpUnit/FunctionalTests.xml;
rm DistributionPackages/JvMTECH.SelectiveMixins/Configuration/NodeTypes.Test.yaml;
```

Installation
------------

[](#installation)

```
composer require jvmtech/selective-mixins

```

---

by [jvmtech.ch](https://jvmtech.ch)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance89

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

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 ~135 days

Recently: every ~160 days

Total

9

Last Release

56d ago

Major Versions

v1.0.2 → 2.0.x-dev2024-06-20

v2.0.0 → v3.0.02025-06-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56817323?v=4)[jvmtech](/maintainers/jvmtech)[@Jvmtech](https://github.com/Jvmtech)

---

Top Contributors

[![sbruggmann](https://avatars.githubusercontent.com/u/1162368?v=4)](https://github.com/sbruggmann "sbruggmann (14 commits)")[![c4ll-m3-j4ck](https://avatars.githubusercontent.com/u/7119811?v=4)](https://github.com/c4ll-m3-j4ck "c4ll-m3-j4ck (6 commits)")[![manuelmeister](https://avatars.githubusercontent.com/u/3001985?v=4)](https://github.com/manuelmeister "manuelmeister (2 commits)")

### Embed Badge

![Health badge](/badges/jvmtech-selective-mixins/health.svg)

```
[![Health](https://phpackages.com/badges/jvmtech-selective-mixins/health.svg)](https://phpackages.com/packages/jvmtech-selective-mixins)
```

###  Alternatives

[neos/neos-ui

Neos CMS UI written in React

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

Flow Form Framework integration into Neos CMS

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

Site package for the Neos Demo Site

18181.0k6](/packages/neos-demo)[flowpack/media-ui

This module allows managing media assets including pictures, videos, audio and documents.

2184.5k2](/packages/flowpack-media-ui)[kaufmanndigital/gdpr-cookieconsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.

2540.7k](/packages/kaufmanndigital-gdpr-cookieconsent)[flowpack/neos-matomo

Track visits of your Neos site with the Matomo Open Analytics Platform!

2337.6k](/packages/flowpack-neos-matomo)

PHPackages © 2026

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