Method: ScrivitoHelper#scrivito_details_for

Defined in:
app/helpers/scrivito_helper.rb

#scrivito_details_for(title = nil, &block) ⇒ Object

Attribute group helper generates HTML for page details dialog and widget details dialog. The generated HTML has appropriate DOM structure and CSS classes, which are compatible with the CSS of the SDK. By using this helper you ensure, that the look of your attribute groups fits into the SDK's design.

Examples:

scrivito_details_for('Title and Category') do
  concat scrivito_tag(:div, @obj, :title)
  concat scrivito_tag(:div, @obj, :category)
end

scrivito_details_for do
  scrivito_tag(:div, @obj, :abstract)
end

Parameters:

  • title (String) (defaults to: nil)

    title of the attribute group.

  • block (Proc)

    content of the attribute group.


333
334
335
336
337
338
339
340
341
342
# File 'app/helpers/scrivito_helper.rb', line 333

def scrivito_details_for(title = nil, &block)
  (:div, class: 'scrivito_content_group') do
    capture do
      if title
        concat (:h3, title)
      end
      concat capture(&block)
    end
  end
end