PHPackages                             wwwision/renderlets-provider - 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. wwwision/renderlets-provider

ActiveNeos-package

wwwision/renderlets-provider
============================

Neos package to provide snippets of data/rendered content (aka 'renderlets') to be consumed by Wwwision.Renderlets.Consumer

1.3.3(1y ago)03.5k↓37.5%2MITPHP

Since Mar 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/bwaidelich/Wwwision.Renderlets.Provider)[ Packagist](https://packagist.org/packages/wwwision/renderlets-provider)[ GitHub Sponsors](https://github.com/sponsors/bwaidelich)[ Fund](https://www.paypal.me/bwaidelich)[ RSS](/packages/wwwision-renderlets-provider/feed)WikiDiscussions main Synced 1mo ago

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

Wwwision.Renderlets.Provider
============================

[](#wwwisionrenderletsprovider)

Neos package to provide snippets of data/rendered content (aka 'renderlets') to be consumed by 3rd parties

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

[](#installation)

Install via composer:

```
composer require wwwision/renderlets-provider

```

Usage
-----

[](#usage)

Renderlets can be defined underneath the Fusion path `/renderlets`:

```
renderlets {
    some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
        renderer = afx`This can be any component`
    }
}

```

With this in place, the renderlet is exposed via HTTP on the endpoint `/__renderlet/some_renderlet`

### Parameters

[](#parameters)

Renderlets can define parameters that can be specified by the consumer via query arguments:

```
renderlet_with_parameters = Wwwision.Renderlets.Provider:Renderlet {
    parameters {
        foo = true
        bar = false
    }
    renderer = afx`foo: {parameters.foo}, bar: {parameters.bar || 'default'}`
}

```

In this example, the "foo" parameter is required (`true`) while "bar" is optional. If the renderlet endpoint is requested without any query parameters (`/__renderlet/renderlet_with_parameters`) a 400 HTTP response is returned with the body:

```
Missing/empty parameter "foo"
```

If the parameters are specified (e.g. `/__renderlet/renderlet_with_parameters?foo=foo%20value&bar=bar%20value`) they are evaluated as expected:

```
foo: foo value, bar: bar value
```

Note

Query parameters that don't match a configured parameter (e.g. `/__renderlet/renderlet_with_parameters?fo=typo`) also lead to a 400 status code to prevent misbehavior due to typos

### Caching

[](#caching)

Each renderlet is assigned a `cacheId` that will be turned into an [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) HTTP header in the response. This allows consumers to send a corresponding `If-None-Match` header in order to prevent unchanged renderlets from beeing transmitted again.

The `cacheId` is a random string by default that gets assigned at rendering time. In order to keep that consistent, a corresponding `@cache` meta property is defined in the renderlet declaration (see ). If the renderlet content depends on other components or data, this property should be extended accordingly:

#### Example

[](#example)

```
some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    @context {
        someNode = ${q(site).children('[instanceof Some.Package:SomeNodeType]').get(0)}
    }
    renderer = afx`Node label: {someNode.label}`
    @cache {
        entryTags {
            someNode = ${Neos.Caching.nodeTag(someNode)}
        }
    }
}

```

Alternatively, the `cacheId` can be set to a static (or dynamic) value to make it deterministic:

```
some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    cacheId = 'some-static-value'
    renderer = afx`Static content`
}

```

For [Renderlet Props](#renderlet-props) the cache behavior can be configured via `renderer.@cache`

Note

Parameters are always part of the cache entryIdentifier, so that every parameter combination is cached individually

### HTTP Headers

[](#http-headers)

#### Content-Type

[](#content-type)

By default, renderlets are rendered with a `Content-Type` header of "text/html". This can be changed via the `httpHeaders` prop:

```
some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    httpHeaders {
        'Content-Type' = 'text/plain'
    }
    renderer = 'This is some plain text'
}

```

#### CORS

[](#cors)

By default, renderlets are rendered with a `Access-Control-Allow-Origin` header of "\*" to allow them to be consumed without [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) restrictions. This can be changed via the `httpHeaders` prop:

```
some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    httpHeaders {
        'Access-Control-Allow-Origin' = 'some-domain.tld'
    }
    // ...
}

```

#### Other headers

[](#other-headers)

Other HTTP headers can be added via the `httpHeaders` prop:

```
some_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    httpHeaders {
        'Content-Language' = 'de-DE, en-CA'
        'X-Custom-Header' = 'some value'
    }
    // ...
}

```

### Localization

[](#localization)

Renderlet enddpoints work independantly from the Neos routing. As a result, nodes from the content repository will be loaded in their default dimension. But parameters are a good option to allow the consumer to change the language:

```
localized_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    parameters {
        lang = true
    }
    @context {
        someNode = ${q(site).children('[instanceof Some.Package:SomeNodeType]').get(0)}
        someNode.@process.translate = ${q(value).context({dimensions: {language: [parameters.lang]}, targetDimensions: {language: parameters.lang}}).get(0)}
    }
    renderer = afx`{q(someNode).property('title')}`
}

```

In this case, a `lang` query argument has to be specified that is used to load a node in the respective context.

Alternatively, the parameter could be made optional:

```
localized_renderlet = Wwwision.Renderlets.Provider:Renderlet {
    parameters {
        lang = false
    }
    @context {
        someNode = ${q(site).children('[instanceof Some.Package:SomeNodeType]').get(0)}
        someNode.@process.translate = ${q(value).context({dimensions: {language: [parameters.lang]}, targetDimensions: {language: parameters.lang}}).get(0)}
        someNode.@process.translate.@if.hasLanguageParameter = ${!String.isBlank(parameters.lang)}
    }
    renderer = afx`{q(someNode).property('title')}`
}

```

### Renderlet Props

[](#renderlet-props)

The `RenderletProps` prototype can be used to render data structures rather than (HTML) content:

```
some_renderlet_props = Wwwision.Renderlets.Provider:RenderletProps {
    properties {
        foo = 'bar'
        baz {
           foos = true
        }
    }
}

```

This will render the following JSON on the endpoint `/__renderlet/some_renderlet_props`:

```
{
	"foo": "bar",
	"baz": {
		"foos": true
	}
}
```

The `Content-Type` header of `RenderletProps` is `application/json` by default, but it can be changed as described above.

#### Cache segments

[](#cache-segments)

When rendering Fusion prototypes with their own `@cache` configuration within renderlets, this can lead to Content Cache markers to appear in the response (see [issue](https://github.com/bwaidelich/Wwwision.Renderlets.Provider/issues/3) for details). Therefore, starting with version [1.3.0](https://github.com/bwaidelich/Wwwision.Renderlets.Provider/releases/tag/1.3.0) those markers are now stripped from the renderlet.

Note, that in order for the automatic cache flushing to work as expected, the `@cache` configuration has to be complete:

```
some_renderlet_props = Wwwision.Renderlets.Provider:RenderletProps {
    @context {
        someNode = ${q(site).find('#517ad799-35df-4324-9429-5c75629a8b34').get(0)}
    }
    properties {
        someRenderedComponent = Some.Package:Foo {
            someNode = ${someNode}
        }
    }
    renderer.@cache {
        entryTags {
            someNode = ${Neos.Caching.nodeTag(someNode)}
        }
    }
}

```

Contribution
------------

[](#contribution)

Contributions in the form of [issues](https://github.com/bwaidelich/Wwwision.Renderlets.Provider/issues) or [pull requests](https://github.com/bwaidelich/Wwwision.Renderlets.Provider/pulls) are highly appreciated

License
-------

[](#license)

See [LICENSE](./LICENSE)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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 ~86 days

Recently: every ~26 days

Total

6

Last Release

721d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/307571?v=4)[Bastian Waidelich](/maintainers/bwaidelich)[@bwaidelich](https://github.com/bwaidelich)

---

Top Contributors

[![bwaidelich](https://avatars.githubusercontent.com/u/307571?v=4)](https://github.com/bwaidelich "bwaidelich (19 commits)")[![kdambekalns](https://avatars.githubusercontent.com/u/95873?v=4)](https://github.com/kdambekalns "kdambekalns (1 commits)")

### Embed Badge

![Health badge](/badges/wwwision-renderlets-provider/health.svg)

```
[![Health](https://phpackages.com/badges/wwwision-renderlets-provider/health.svg)](https://phpackages.com/packages/wwwision-renderlets-provider)
```

###  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)
