content_for
Content renderer for objects inside the Plate Nested Layout Structure: Post
, Section
, Row
, Column
and Content Element
. This not only renders the content, but also makes sure the content is editable for the user in the site’s edit mode, and adds HTML attributes for positioning so the content shows in the right place.
You can add custom HTML attributes to extend the HTML container. If you add disable_handles: true
, the content won’t show editing handles in edit mode, so the user is kept from editing the content.
You can also add custom HTML attributes to the render_content
tag inside the content_for
block. This generates a div within the outer container, containing the content. This especially comes in handy for sections (which usually are full page width), that have a container div inside (that conforms to the Plate responsive grid system).