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

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.46.0 Released

    Interface Builder improvements Using attributes of the current page context Attributes of the current page and its ancestors are now available to editors as placeholders and as a data source (datalocator). Note that only attributes of the string type that are also included as attributes in the...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.45.0 Released

    Interface Builder Supports Further Attribute Types for Filtering

    Interface Builder improvements Filtering data by enum, boolean, date, and number attributes The Interface Builder’s data editor now also lets you filter data by attributes of the enum , boolean , date , and number types. This makes it much more convenient and intuitive to select and present data...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.44.2 Released

    Bugfix Release An issue with Scrivito.useDataLocator has been fixed. It prevented filters with reference data attributes from being evaluated properly. We apologize for any inconvenience this issue may have caused! Thanks again for using Scrivito!

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.44.1 Released

    Maintenance release This is a maintenance release with minor improvements. As always, we will keep you posted if there is anything interesting to report. Stay tuned! Thanks again for using Scrivito!

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.44.0 Released

    Interface Builder improvements LinkTag supports data items The LinkTag component now supports data items as navigation targets. Passing a DataItem to the to prop causes the link to point to the details page of the item concerned. Accessing current data of a specific class The useDataScope and...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.43.0 Released

    Interface builder improvements Data attributes For the application to utilize the attributes selected by content editors, the Scrivito SDK now includes a (beta) API for representing data attributes, DataItemAttribute . A data item attribute can be accessed from a data item via...

  • Providing Data Classes with Custom Attributes

    Latest updates to edit.scrivito.com

    Defining custom attributes via the Interface Builder’s data editor The data editor now lets you add custom attributes to data classes. If, for example, you have a “Current user” data class that requires an attribute not specified in the editing configuration of this class, e.g., “email”, you can...

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.42.1 Released

    Bugfixes Data integration issue > DataItem#get > no longer requires a loading context, i.e., > Scrivito.load > or > Scrivito.connect > . We apologize for any inconvenience the above issue may have caused! Thank you for using Scrivito!

  • Scrivito Enterprise CMS - Product Illustration

    Scrivito JS SDK 1.42.0 Released

    Interface Builder improvements DataScope#limit() API method The new DataScope#limit() method determines the maximum number of data items a DataScope may contain. It returns either a number indicating this limit, or undefined if no limit is set. Introducing Scrivito.currentLanguage()...

  • Introducing the ​New Data Editor

    Latest updates to edit.scrivito.com

    > > As you may have noticed, we have been continuously refining and expanding the Interface Builder. Now the time has come for a correspondingly enhanced data editor. > > The new data editor comes with an intuitive interface that provides a visual representation of a data locator as well as...