Sha256: 3875d1cd12aab01e7dada60513ef47fc82e6f56e7d144cd70df81c9c17873674

Contents?: true

Size: 359 Bytes

Versions: 1

Compression:

Stored size: 359 Bytes

Contents

# Register a JavaScript search API result format used by the content browser.
Scrivito::Configuration.register_obj_format('content_browser') do |obj|
  format = {
    id: obj.id,
    title: obj.description_for_editor,
  }

  if obj.binary_content_type && obj.binary_content_type.start_with?('image/')
    format[:preview] = obj.binary_url
  end

  format
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scrivito_content_browser-0.30.0 config/initializers/scrivito_content_browser.rb