\Slice
Synopsis
class Slice
extends DataObject
implements
DataObjectPreviewInterface
{
- // members
- private static array $dependencies = ;
- private static array $db = ;
- private static array $has_one = ;
- private static string $default_sort = 'Sort ASC';
- public DataObjectPreviewer $previewer;
- // methods
- public FieldList getCMSFields()
- public void onBeforeWrite()
- public void setClassNameByTemplate()
- protected void configureFieldsFromConfig()
- protected void configureFieldTypes()
- protected void configureFieldHelp()
- protected void configureFieldLabels()
- protected void addTemplateControlFields()
- protected void configureUploadFolder()
- public array getTemplateNames()
- public string getDefaultTemplate()
- public bool hasLayoutOption()
- public string getPreviewHtml()
- public string getPreview()
- public HTMLText forTemplate()
- protected SSViewer getSSViewer()
- protected string getTemplateClass()
- protected string getBaseSliceClass()
- protected array getTemplateList()
- protected array getTemplateSearchNames()
- protected string convertCamelCaseToWords()
- protected void removeUnconfiguredFields()
- protected array getConfiguredFieldNames()
- protected void modifyFieldWithSetting()
- protected array getCurrentTemplateConfig()
- protected array getTemplateConfig()
- protected array normaliseTemplateConfig()
Hierarchy
Extends
- DataObject
Implements
- DataObjectPreviewInterface
Members
Methods
protected
- addTemplateControlFields() — Add built-in controls for preview and changing the template and visual options These are always visible and can't be hidden from the slices config
- configureFieldHelp() — Apply the 'help' key from a template config to fields
- configureFieldLabels() — Apply the 'label' key from a template config as field titles
- configureFieldTypes() — Convert fields to a different field class where configured
- configureFieldsFromConfig() — Configure fields using a template's config
- configureUploadFolder()
- convertCamelCaseToWords() — Convert identifiers into words to show to the user
- getBaseSliceClass() — Return the class name to revert to when no 'className' key is set in the template config
- getConfiguredFieldNames()
- getCurrentTemplateConfig() — Get the config for the template name currently configured in $this->Template
- getSSViewer() — Tries to get an SSViewer based on the current configuration
- getTemplateClass() — Return the class name to prefix templates with
- getTemplateConfig() — Get the config for a template of this slice
- getTemplateList() — Return a list of templates to pass to an SSViewer when rendering
- getTemplateSearchNames() — Return a list of template file names that can be used for the slice
- modifyFieldWithSetting() — Run a callback for each field config that contains a setting key
- normaliseTemplateConfig()
- removeUnconfiguredFields() — Remove all fields except those with specified in a template config
public
- forTemplate() — Render the slice
- getCMSFields()
- getDefaultTemplate() — Get the template config name to be selected by default for new slices
- getPreview() — Used in templates to get a iframe preview of the slice
- getPreviewHtml() — Returns a rendered state to use with the dataobject preview field
- getTemplateNames() — Get a map of template types to human-readable names
- hasLayoutOption() — Check if there is a visual option matching the name specified
- onBeforeWrite()
- setClassNameByTemplate() — Change class name based on the config for a template