fromholdio/silverstripe-resourceful

Installs: 101

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.3.0 2024-02-19 12:57 UTC

This package is auto-updated.

Last update: 2024-12-19 14:46:06 UTC


README

Often a CMS UI will have a recurring pattern of a checkbox to enable/disable inheritance of a value/s, and when unchecked, the user can either choose an alternative source of the value, or enter fresh values into a form field/s.

For example:

  • by default I inherit the feature image for a page from its parent page
  • if I disable/uncheck that inheritance, I'm shown an optionsetfield to choose whether to a) use the global default feature image, or b) upload a new feature image
  • when I choose b), I'm shown a file upload field to upload a new feature image

This module is quite abstract, it provides the means to implement this pattern, mainly through config yml.

Requires Silverstripe 4+ or 5+.