arillo / silverstripe-elements-global
Global Elements
Package info
github.com/arillo/silverstripe-elements-global
Type:silverstripe-vendormodule
pkg:composer/arillo/silverstripe-elements-global
Requires
This package is auto-updated.
Last update: 2026-02-20 21:43:52 UTC
README
Elements-global will allow you to define specific elements as being global. Global elements can be added to pages by creating a VirtualElement that will work as a link/placeholder to the global element.
The elements that should be available globaly should implement the IElementsGlobal interface. When creating this elements via a ModelAdmin they will automatically get the flag Global set to true.
You need to specify at least one Element that implements the IElementsGlobal interface.
class HeroElement extends ElementBase implements IElementsGlobal { ... }
You can restrict the allowed elements to be referenced by a virtual element on a per pagetype basis on your config.yml via the virtual_elements attribute.
HomePage: element_relations: Elements: - HeroElement - DownloadElement - TeaserElement - VirtualElement Sidebar: - HeroElement - VirtualElement virtual_elements: Elements: - HeroElement