lib/scrivito/configuration.rb in scrivito_sdk-0.65.2 vs lib/scrivito/configuration.rb in scrivito_sdk-0.66.0.rc1
- old
+ new
@@ -205,10 +205,11 @@
def set_defaults!
self.ca_file = DEFAULT_CA_FILE
self.endpoint = 'api.scrivito.com'
self.check_batch_size = 100
self.legacy_routing = false
+ self.default_image_transformation = {}
end
#
# Configures the in-place UI to use a locale different from the one used by the rest of the
# application.
@@ -231,9 +232,30 @@
# Scrivito changed its routing to a slug first url scheme. This configuration option
# allows you to switch back to the old id first url scheme.
attr_accessor :legacy_routing
attr_accessor :choose_homepage_callback, :check_batch_size
+
+ #
+ # Set the default {Scrivito::Binary#transform image transformation}.
+ #
+ # @api beta
+ #
+ # When delivering binary Objs, the default image transformation will be applied if
+ # {Scrivito::BasicObj#apply_image_transformation? Obj#apply_image_transformation?} returns
+ # +true+.
+ #
+ # If not changed the default image transformation is an empty transformation (an empty +Hash+).
+ # Set it to +false+ to disabled the default image transformation completely.
+ #
+ # @param [Hash] value the {Scrivito::Binary#transform transformation definition}
+ #
+ # @see Scrivito::Binary#transform
+ # @see Scrivito::BasicObj#apply_image_transformation?
+ #
+ attr_writer :default_image_transformation
+
+ attr_reader :default_image_transformation
# Configure a callback to be invoked when the Scrivito SDK delivers the homepage.
# The given callback will receive the rack env
# and must return an {BasicObj Obj} to be used as the homepage.
# If no callback is configured, {BasicObj.homepage Obj.homepage} will be used as the default.