Method: Scrivito::AttributeContent#valid_widget_classes_for

Defined in:
app/cms/scrivito/attribute_content.rb

#valid_widget_classes_for(field_name) ⇒ nil, Array<Class>

Hook method that lets you control the widget classes that are made available for adding instances of them to this page or widget. Override it to allow only specific classes or none at all. Must return either NilClass, or Array.

If nil is returned (default), all widget classes will be available for this page or widget.

If an Array is returned, it is expected to include the permitted classes. Their order is preserved as they are offered to the user via the widget browser.

Parameters:

  • field_name (String)

    Name of the widget attribute.

Returns:

  • (nil, Array<Class>)

See Also:



134
135
# File 'app/cms/scrivito/attribute_content.rb', line 134

def valid_widget_classes_for(field_name)
end