Sha256: 0bd43a6384a055182a04951e2824139857e3726a8159b9fe68becb58f52ae363

Contents?: true

Size: 328 Bytes

Versions: 1

Compression:

Stored size: 328 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.respond_to?(:image?) && obj.image?
    format[:preview] = obj.body_data_url
  end

  format
end

Version data entries

1 entries across 1 versions & 1 rubygems

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