Method: ScrivitoHelper#scrivito_widget_tag

Defined in:
app/helpers/scrivito_helper.rb

#scrivito_widget_tag(html_options, &block) ⇒ Object

This helper can be used in the show.html.* template of widgets. It allows you to specify attributes (including CSS classes) for the tag enclosing the widget.

Examples:

It should be wrapped around the entire template like this:

<%= scrivito_widget_tag class: 'my_class', data-very-funky: true do %>
  <%= scrivito_image_tag widget, :image %>
<% end %>

Parameters:

  • html_options (Hash)

    attributes for this tag.



473
474
475
476
477
# File 'app/helpers/scrivito_helper.rb', line 473

def scrivito_widget_tag(html_options, &block)
  capture(&block).tap do
    @scrivito_widget_tag_html_options = html_options
  end
end