Block visibility

For RestFul 1.x


You have a content type that you want to be display on specific pages. You want to use the same system as Drupal core block visibility.

Proposed resolution

Add a textarea field to your content type called visibility, with a machine name of field_block_visibility.

Visibility Block Textarea field

Create or add to your endpoint the following code:

CacheableDependencyInterface & friends

To make dealing with cacheability metadata (cache tags, cache contexts and max-age) easier, Drupal 8 has CacheableDependencyInterface.

Cache max-age

Cache max-age = time dependencies

Cache max-age is analogous to HTTP's Cache-Control header's max-age directive


Cache max-age provides a declarative way to create time-dependent caches.

Smart Cache

Drupal 8 provides a Smart Cache module that is recommended for websites of all sizes. It caches pages minus the personalized parts, and is therefore useful for all users (both anonymous & authenticated).

We can find this core module at: core/modules/smart_cache.

Other errors not specific to ERPAL for Service Providers

For other errors not specific to ERPAL for Service Providers, but general to Drupal, please visit the page at


Subscribe with RSS Subscribe to RSS - No known problems