Scrivito 1.1.0 Release Notes

Improvements

Introducing faceted search

The Scrivito SDK now lets you do faceted searches for having search results categorized, for example. By using specific properties, e.g. the product vendor in a shop application, you can now offer your visitors a means to quickly narrow down what they are looking for. Faceted search also covers generating tag clouds dynamically, or providing auto-completion to editors. Here's an example showing how to determine the eight tags most often given to downloads as well as the three languages most often assigned to CMS objects of this class:

There are two flavors of faceting, the one exemplified above, for specifying up to ten attributes, and a single-attribute variant that lets you specify the attribute and the options directly:

You can have the matching CMS objects included in the search result. For details, please refer to the API documentation.

Freely customizable routing

In addition to providing the slug method, which lets you customize the URLs under which your pages are available, Scrivito now gives you full control over the routing it adds to your application. For this, the new scrivito_route API is available. An example:

For usage examples or details regarding the parameters of scrivito_route, please refer to the provided documentation.

How to upgrade your application

The routing you are familiar with from previous Scrivito versions remains functional, and there is no need for immediate action. However, customizable routing will be the default in the next major version, and we therefore recommend upgrading your application. The first step is to enable customizable routing by disabling the routes Scrivito injects into the application:

Then, append the following lines to your config/routes.rb file:

Your routing should now work as before and can easily be customized to fit your needs.

Legacy routing

With the introduction of the new routing API, the legacy_routing configuration has been deprecated. This option enabled the old ID-first routing. However, this old behaviour can be easily reestablished using the new scrivito_route API:

New default HTML editor

As promised recently, MediumEditor now is the new default for editing HTML markup in WYSIWYG mode.

You can still go back to Redactor by specifying use("redactor") in scrivito.select_editor. Alternatively, add the editor: "redactor" option to an individual scrivito_tag.

Auto-completion for string lists

Auto-completion is an often requested feature, so we provided the in-place editor for attributes of the stringlist type with this functionality. It is the default editor for such attributes, meaning that auto-completion is available for them out-of-the box.

Currently, auto-completion is based on a best-effort approach to finding the 100 most popular items (e.g. tags) contained in equally named stringlist attributes part of one or more object classes. Note that the attributes searched for auto-completion are taken from the published content, not from the current working copy. Also, only stringlist attributes that were declared for object classes representing CMS objects are considered, meaning that auto-completion does not take account of string lists contained in widgets.

Copying images or other binaries via the JS API

Using the JavaScript API and jQuery's save and content methods, it is now possible to copy the values of binary attributes. This is useful, for example, when creating CMS objects that should be provided with a default image. As an example, the following code copies the value of the binary attribute whose DOM-ID is source_binary_field to the binary attribute named target_binary_field:

For further details as well as examples, please refer to the documentation we provided.

Utilizing fragment caching

The Scrivito SDK now includes a helper, scrivito_cache, for utilizing Rails' fragment caching in your application. Fragment caching applies to computed parts of views and helps to improve performance.

The scrivito_cache method expands built-in fragment caching by automatic recomputation of the cached parts of a view when Scrivito content changes. The fragments are only cached for the published content. In editable working copies no caching takes place, and the fragments are computed for every request. A usage example:

Additionally, the new Scrivito::Workspace#cache_key method lets you build your own caching solution. For details, please refer to the documentation.

If you are not familiar with caching yet, take a look at the excellent Rails guide on this topic.

Further improvements

If you haven't provided a filter configuration for the Content Browser, a default filter set becomes effective now.

The default filter set lets editors find either all CMS objects, images, or downloads (binaries with the exception of images). Also, CMS objects that are new or have been edited in the working copy can be found easily.


There is a new method, Obj#sorted_toclist, which returns the non-binary children of a given CMS object, similar to Obj#toclist. However, this methods sorts the CMS objects based on the child_order attribute, which is also used for sorting built-in navigations. See Making Navigations Sortable for details on how to utilize the child_order attribute.


The scrivito_tag helper now includes a simple default representation of attributes of the stringlist, enum, multienum, link, linklist, reference and referencelist types, so you do not need to provide your own rendering helpers for them as described in the SDK 0.90.0 Release Notes.

Changelog

The changelog reflects minor improvements and bugfixes that were made in addition to the changes listed above.

Details

Minor improvements

  • You can now clear searches in the Content Browser using a button we placed next to the search input field.
  • We've improved the way technical errors are reported in the UI, so that the editor is able to provide the time of occurrence and the error details to the technician.
  • After a file has been dropped onto a drop zone, Scrivito now immediately displays an upload progress indicator.
  • There are two new JavaScript API methods, scrivito.path_for_id and scrivito.id_from_path, which come in handy when extending in-place editing functionality, e.g. when letting editors create CMS objects via the JavaScript API.
  • The editor for attributes of the enum type now supports data-scrivito-editors-reload=true. This feature was requested to support details views that compute the value to display.
  • Trying to create a CMS object based on a nonexistent class using the Content Browser or scrivito.create_obj now causes a comprehensible error message to be displayed.
  • In the page and widget selection dialogs, the number of items in the “Often used” section is now limited to five.
  • The direction in which the results of a search should be sorted can now be specified alongside the field. For example, to have all CMS objects sorted from the most recently updated one down to the one that has not been touched the longest, use:
    Obj.all.order(_last_changed: :desc)
    Or, with JavaScript, fetch the most recently updated images:
    scrivito.obj_where('_obj_class', 'equals', 'Image').order({_last_changed: 'desc'})
    The reverse_order method is now deprecated and will be removed with the release of Scrivito 2.0.

Bugfixes

  • Scrivito now actively checks whether the options given in an attribute declaration contain correct keys. It also checks whether the values provided for enum and multienum attributes are strings.
  • We fixed a problem that prevented the enter and escape hotkeys for canceling and confirming various dialogs from working as expected.
  • Editing a string in conjunction with data-scrivito-editors-reload=true no longer leads to outdated content being displayed after reloading.
  • With Firefox, the position of the caret within empty string fields sometimes had an unexpected offset.
  • We fixed a bug which, in editing mode, caused an unnecessary search request to be issued for referenced images.
  • Using a date in an invalid format in the JavaScript API now results in an error on the client side only. Previously, an exception was raised on the server.
  • We fixed the bug that caused the context menu of empty widget lists to be broken sometimes.
  • The working copy menu in the Scrivito UI is now aware of permissions and disables the items the editor is not allowed to select.
  • The buttons for editing an image and clearing a binary field no longer become unresponsive after drag and drop operations.

More great blog posts from Andreas Viebke

  • Editing Interface Alignment with Dartagnan

    For an improved overall user experience, we’ve aligned the user interface design of Scrivito with that of our email builder Dartagnan. We wanted to create a consistent look and feel for our customers working with these cloud products from JustRelate. The adjustments we made are geared towards...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.41.0 RC 1 Released

    Interface Builder improvements Handling data connection errors If you encounter an issue inside your connection callback (e.g. an HTTP 4xx response from a backend), and you want to communicate this to the user, you can now resolve the callback using a Scrivito.DataConnectionError instance to...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.40.0 Released

    Improvements Intermediately rendered components during loading time Scrivito.provideComponent now lets you give proper feedback to the visitor in cases where the actual component that is provided requires some time to load and render itself. This usually short time gap can now be bridged by...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.39.0 Released

    Improvements Enhanced data classes The Scrivito SDK now offers all attributes of a data class as placeholders for its instances, unless configured otherwise via the editing configuration. > As a developer using > Scrivito.provideDataClass > to load external data, you can now also return IDs of...

  • Bienvenue sur Scrivito !

    Latest updates to edit.scrivito.com

    Bienvenue sur Scrivito ! For all you French-speaking users, the Scrivito editing interface is now also available in your language. In addition to dialogs and buttons in French, input fields for page and widget properties have support for locale-specific calendar labels and French number...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.38.0 Released

    Improvements Accessing the current user’s picture The Scrivito.currentEditor API now seamlessly integrates with IAM, allowing developers to access the picture URL associated with the current editor’s IAM profile. Easier attribute type migration There are situations in which a developer needs to...

  • Creating and Linking a Details Page

    Latest updates to edit.scrivito.com

    > After introducing details pages for data items in version 1.36.0 of the Scrivito SDK, the editing interface now offers you to create such a page for a given data class directly from within a data item. If, for example, you have a card widget in your data list widget, and this card widget has a...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.37.0 Released

    Improvements Updating data items using custom logic By defining the update callback of Scrivito.provideDataItem , you can now smoothly update data items using your own logic. This gives you greater control and flexibility in managing your data within your Scrivito app. Prerendering fails early...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.36.1 Bugfix Release

    This release fixes a bug found in version 1.36.0 of the Scrivito JS SDK: Under certain conditions, the renderChild prop of Scrivito.ChildListTag received an argument that was not a child object. This could lead to unexpected app crashes. We apologize for any inconvenience this may have caused!

  • Managing Users and Teams in the JustRelate Console

    Latest updates to edit.scrivito.com

    Scrivito’s user management has moved to the Console After introducing the JustRelate Console in April this year and announcing that authorized Scrivito users would be able to manage their account’s users and teams there, we finally did it: Clicking “Manage users” in the main menu now opens a new...