The Ruby API

Helper methods

With only very few exceptions, the Fiona 7 API corresponds to Scrivito’s API. All methods except fiona7_login_button, fiona7_head_tags, and fiona7_body_tags are available in legacy mode only.

fiona7_login_button

Creates a button which is linked to the log-in page.

fiona7_head_tags

Does the same as scrivito_head_tags in Scrivito applications. Must be called in the HEAD section of a page to activate the editing components.

fiona7_body_tags

Does the same as scrivito_body_tags in Scrivito applications. Must be called in the BODY section of a page to activate the editing components.

fiona7_tag(tag_name, obj_or_widget, field_name, html_options = {}, editing_options = {}, &block)

For use in legacy mode only. Works like scrivito_tag, but additionally accepts as the second argument a RailsConnector::BasicObj instance, which makes in-place editing also available in classic RailsConnector views.

fiona7_tag_list(tag_name, obj, field_name, options = {}, &block)

For use in legacy mode only. Works like scrivito_tag_list, but additionally accepts as the second argument a RailsConnector::BasicObj instance.

fiona7_workflow_buttons

For use in legacy mode only. Renders a drop down menu with workflow commands related to the current CMS object, such as edit, take, forward, commit, sign, reject, and release. Which actions are active depends on the underlying workflow.

RailsConnector::BasicObj#scrivito_obj

For use in legacy mode only. In legacy mode, every RailsConnector object has this method. It returns an instance of Scrivito::BasicObj and thus makes it possible to use the Scrivito API methods in legacy mode. If, for example, @obj is an instance of the Publication RailsConnector class and includes a widget attribute named main_content, this attribute can be rendered using:

<%= scrivito_field @obj.scrivito_obj, :main_content %>

Scrivito::BasicObj#fiona_obj

For use in legacy mode only. In legacy mode, every Scrivito object has this method which is the reversal of scrivito_obj and returns an instance of RailsConnector::Obj. Supports mixed operation of the RailsConnector and Fiona 7.

The “Obj" class

Analogous to the RailsConnector, both Fiona 7 and Scrivito require an Obj class. If the Obj class has already been defined globally by the RailsConnector – which is the case in legacy mode –, you should use in_place blocks to have shadow classes generated which are derived from Scrivito::BasicObj. An example:

class Obj < RailsConnector::BasicObj
  in_place do
    attribute :headline, :string
  end
end

This analogously applies to the classes of formats, be it for regular CMS objects or widgets.