Scrivito 0.90.0 Release Notes

Items added or changed after the release of RC 1 are marked with [0.90.0.rc2] or [0.90.0.rc3], repectively. Improvements New API for defining and selecting editors The JavaScript API now provides a more concise way to define an editor for in-place editing: scrivito.define_editor("editor_name", { can_edit: function(element) { // 1. Check whether the editor is suitable for editing the element. }, activate: function(element) { // 2. Activate the editor. } }); The UI calls can_edit to determine whether the editor is capable of editing the given element. If the callback returns a truthy value, activate is called to activate the editor. We also provided a new API for specifying the editor to use for a particular field: scrivito.select_editor(function(element, editor) { if ($(element).is(".my_field")) { editor.use("my_editor"); // Use "my_editor" if CSS class is "my_field". } if ($(element).is(".restricted_field")) { editor.disable(); // Disable editing if CSS class is "restricted_field". } }); If the select_editor callback specifies the editor to use, the UI checks whether this editor exists and, if it does, as mentioned above, calls its can_edit method to determine whether the editor is suitable for editing the field. If it is, the UI activates the editor by calling its activate method. Call the disable method of an editor to completely prevent the field from being edited, regardless of any subsequent calls to use. There is more detailed documentation on using and defining editors. One helper to render them all The scrivito_tag view helper now renders attributes for which dedicated helpers were needed previously. Therefore, these dedicated helpers were removed, namely scrivito_edit_enum, scrivito_edit_multienum, scrivito_edit_reference, scrivito_edit_referencelist, scrivito_edit_link, and scrivito_edit_linklist. When upgrading to this SDK version, calls to them should be replaced with calls to the scrivito_tag helper: # Instead of <%= scrivito_edit_enum @obj, :my_enum %> <%= scrivito_edit_multienum @obj, :my_multienum %> <%= scrivito_edit_reference @obj, :my_reference %> <%= scrivito_edit_referencelist @obj, :my_referencelist %> <%= scrivito_edit_link @obj, :my_link %> <%= scrivito_edit_linklist @obj, :my_linklist %> # you should now simply write <%= scrivito_tag :div, @obj, :my_enum %> <%= scrivito_tag :div, @obj, :my_multienum %> <%= scrivito_tag :div, @obj, :my_reference %> <%= scrivito_tag :div, @obj, :my_referencelist %> <%= scrivito_tag :div, @obj, :my_link %> <%= scrivito_tag :div, @obj, :my_linklist %> The helpers were removed because they are no longer required for activating the corresponding editors. Instead, the editors are now activated by default for the attribute types concerned. Previously, these helpers were also needed to have the attribute values rendered in preview mode. However, the scrivito_tag helper does not yet provide this functionality and doesn't render markup equivalent to the markup the removed helpers produced. In most cases, though, you probably haven't used those helpers in views responsible for displaying the preview. But if you did and wish to stick to the formatting previously provided by these helpers, you might want to define them in your application: def scrivito_edit_enum(obj_or_widget, attribute_name, options = {})  scrivito_tag(:div, obj_or_widget, attribute_name, options) end def scrivito_edit_multienum(obj_or_widget, attribute_name, options = {}) scrivito_tag(:div, obj_or_widget, attribute_name, options) do obj_or_widget[attribute_name].join(", ") end end def scrivito_edit_reference(obj_or_widget, attribute_name, options = {}) scrivito_tag(:div, obj_or_widget, attribute_name, options) do obj_or_widget[attribute_name].try(:description_for_editor) end end def scrivito_edit_referencelist(obj_or_widget, attribute_name, options = {}) referencelist = obj_or_widget[attribute_name] scrivito_tag(:div, obj_or_widget, attribute_name, options) do if referencelist.any? content_tag(:ul) do capture do referencelist.each do |reference| li = content_tag(:li) do content_tag(:span, reference.description_for_editor, class: "list-content") end concat li end end end end end end def scrivito_edit_link(obj_or_widget, attribute_name, options = {}) link = obj_or_widget[attribute_name] || Scrivito::Link.new(url: "") scrivito_tag(:div, obj_or_widget, attribute_name, options) do content_tag(:ul) do content_tag(:li) do content_tag(:span, class: "list-content") do query = link.query.present? ? "?#{link.query}" : "" fragment = link.fragment.present? ? "##{link.fragment}" : "" url = link.internal? ? scrivito_path(link).sub(/\?.*/, "#{query}#{fragment}") : link.url description = link.internal? ? link.obj.description_for_editor : link.url "#{link.title} #{link_to(description, url, target: :_blank)}".html_safe end end end end end def scrivito_edit_linklist(obj_or_widget, attribute_name, options = {}) linklist = obj_or_widget[attribute_name] scrivito_tag(:div, obj_or_widget, attribute_name, options) do if linklist.any? content_tag(:ul) do capture do linklist.each do |link| li = content_tag(:li) do content_tag(:span, class: "list-content") do query = link.query.present? ? "?#{link.query}" : "" fragment = link.fragment.present? ? "##{link.fragment}" : "" url = link.internal? ? scrivito_path(link).sub(/\?.*/, "#{query}#{fragment}") : link.url description = link.internal? ? link.obj.description_for_editor : link.url "#{link.title} #{link_to(description, url, target: :_blank)}".html_safe end end concat li end end end end end end Breaking changes Scrivito now raises an error if the scrivito_tag helper is used to render an attribute that doesn't exist. We unified the naming of the data attributes recognized by Scrivito's in-place editors. Scrivito's editors can be configured through various HTML data attributes. These attributes weren't named consistently in the past. From this release on, all data attributes recognized by Scrivito editors are prefixed with data-scrivito-editors-: Deprecated Renamed to data-autosave data-scrivito-editors-autosave data-date-format data-scrivito-editors-date-format data-filter-context data-scrivito-editors-filter-context data-filters data-scrivito-editors-filters data-max data-scrivito-editors-max data-min data-scrivito-editors-min data-newlines data-scrivito-editors-multiline* data-placeholder data-scrivito-editors-placeholder data-reload data-scrivito-editors-reload data-step data-scrivito-editors-step data-time-format data-scrivito-editors-time-format data-values not used *On this occasion, we also renamed data-newlines (now deprecated) to data-scrivito-editors-multiline. Please refer to the documentation for the complete list of available data attributes. We also streamlined the naming of Scrivito Editors. The Redactor WYSIWYG editor can now be made available using the editor: 'redactor' option of the scrivito_tag helper, but you might also continue using the default editor: 'html'. For not being chained to Redactor, use html to activate the primary WYSIWYG HTML editor, which is going to be the Medium Editor from one of the upcoming releases. If you have been using scrivito.editors.html_editor.redactor.options in your JavaScript, please update to scrivito.editors.redactor_editor.options. Because of buggy and cumbersome behavior, Scrivito no longer lets you set empty strings as selectable values of enum or multienum attributes. Further improvements and changes We added an alternative HTML editor to the collection of Scrivito Editors. You can now offer the MediumEditor to website editors for even more WYSIWYG convenience. Just request the new medium editor in your scrivito_tag: scrivito_tag(my_obj_or_widget, :my_html_attribute, {}, editor: :medium) Workspaces now have a published? method. It lets you determine for a specific working copy whether it is the published one or not. In addition, the published class method was provided for retrieving the workspace that represents the published content. For example, you can now write the following code to retrieve all editable working copies: editable_workspaces = Scrivito::Workspace.all.reject(&:published?) # or editable_workspaces = Scrivito::Workspace.all - [Scrivito::Workspace.published] [0.90.0.rc2] In the JavaScript API, the present, disabled, and execute callbacks that can be specified in $.scrivito("menu").add, $.scrivito("menu").update or $.scrivito("menu").replace are no longer provided with the DOM element concerned since this element can be derived from the context. Bugfixes We fixed a bug in the scrivito_details_for helper that occurred when it was called outside of a view, e.g. in a helper. In such cases, the return value of the block was not rendered. The "Click to edit" placeholders are now always clickable in Chrome. The JavaScript search API (scrivito.obj_where) had a bug that caused searches by date to take account of the year only. For example, searching for all CMS objects changed after May 5, 2015 returned all CMS objects changed in 2015. This bug has been fixed. [0.90.0.rc3] We fixed the problem that in-place editors weren't activated again on pages after the details view, which used the same editors, had been opened.

More great blog posts from Andreas Viebke

  • Scrivito Rails 1.16.0 RC 2 Released - Rails 5.2 Support & Improved Link Editor

    Improvements Supports and requires Rails 5.2 Scrivito now supports and requires Rails 5.2. Please update your app to Rails 5.2 before upgrading to Scrivito 1.16. There are no Rails 5.2 specific Scrivito settings, therefore this part of the update should be smooth. For instructions and details on...

  • Scrivito JS 1.6.0 RC 3 – More Editing Tools & Progressive Image Loading

    Major improvements Reverting changes and restoring widgets Scrivito now lets editors revert the changes made to individual widgets. For this, corresponding menu items are available in the respective widget menus. Furthermore, in the “Changes” view mode, a deleted widget can now be restored to its...

  • Scrivito JS 1.5.0 Featuring Changes View Mode & Hierarchy Browser

    Major improvements View the changes made to a page How often do you have to question a team mate about the changes they made to a specific page? You could compare a reworked page with its published version instead, but that’s a tedious job in most cases. No longer. The Scrivito UI now provides a...

  • Staged Deployment with Scrivito and Netlify

    What do you mean by "I don't need a staging server"?

    It used to be... It used to be that a large part of releasing changes to a professional website required a long list of steps to ensure secure propagation of changes through the development cycle into production. Each part needed to be kept in sync with the next, or the whole flow would break....

  • Scrivito Rails SDK 1.15.0 Has Been Released

    Improvements Changes dialog displays last editor On the changes dialog of a working copy, the individual items now include the name of the user who most recently edited them. So, should questions arise regarding the changes made to a page (for example when publishing), instead of navigating to...

  • Scrivito JS SDK 1.4.0 Is Available

    Editing interface improvements Changes dialog displays last editor On the changes dialog of a working copy, the individual items now include the name of the user who most recently edited them. So, should questions arise regarding the changes made to a page (for example when publishing), instead...

  • Scrivito JS SDK 1.3.0 Is Available

    Major improvements Tour for beginners Scrivito now includes a tour, which introduces the main editing controls to users who are new to Scrivito. After opening the Example App from within the dashboard, the tour starts automatically, but it can also be started using the "Start tour" item in the...

  • Live Updating now also Works in Editing Mode

    Recently, we announced Scrivito’s new live updating feature that lets editors see the changes made by their coworkers. Up to now, this only worked in preview mode, but still was a great achievement as it significantly improves collaboration. We promised to make live updating available in editing...

  • Scrivito Rails SDK 1.14.0 Has Been Released

    General improvements Publishing via the top bar For better accessibility and even more convenience, the top bar (also known as panel) of Scrivito’s in-place editing interface now includes a “Publish” button. In contrast to the “Publish” button in the sidebar, the new top bar button opens the...

  • Scrivito JS SDK 1.2.0 Is Available

    Major improvements Live updating, part 2 Recently, we praised live updating (we first called it auto updating) as truly beneficial to collaborative settings such as reviews. And it is, because changes to a page become immediately visible to the participants. However, live updating was functional...

  • Introducing Publish Webhooks

    Scrivito now lets you call web services each time a working copy of your CMS is published. This allows you to initiate post-processing actions (e.g. pre-rendering), but also to notify anyone interested, for example by sending emails, posting a message to your team collaboration tool, and much...

  • Introducing Smart Content Auto-Merging

    Scrivito working copies are virtual copies of the entire website and a feature that allows editors to change content safely in a sandbox. A working copy lets you change or add as much content as you want or need to, and publish everything at the push of a button. Sometimes, it’s just a single...

  • Collaborating Real-Time with Scrivito

    In mid-February, we launched Scrivito 1.0, our JavaScript-based CMS with unmatched in-place editing: add widgets from a large extensible selection to a page, rearrange them to your liking, add your content. From what we’ve gathered from our customers, the user experience is so amazingly smooth –...

  • Scrivito JS SDK 1.1.0 Is Available

    After successfully launching Scrivito in mid-February this year and collecting valuable feedback from testers and customers, we set ourselves to work: There is nothing that cannot be improved. Major improvements Auto updating Wouldn't it be nice if the changes made by other editors were instantly...

  • Scrivito Rails SDK 1.13.0 Has Been Released

    Content Browser improvements File upload made easier The Content Browser now has a button for uploading images via the file selection dialog of your operating system. If drag and drop isn’t yours, click this button and conveniently browse your image directories wherever they may be...

  • Leaving WordPress Behind?

    WordPress has given millions of individuals, companies, and organizations a means for getting heard, for advertising and selling their products, or promoting their ideas on the web, no question. It works, and, initially, it’s free – so why care about alternatives? Do you wish for an easier, more...

  • Scrivito 1.11.0 Release Notes

    Ready for Rails 5.1 You can now integrate Scrivito into Rails 5.1 applications! Rails 5.0 and 4.2 continue to be supported. The latest Rails version is stuffed with new and improved functionality – see the Rails 5.1 release notes for details! Updated and improved HTML editor Scrivito includes...

  • Scrivito 1.10.0 Release Notes

    More options for creating, copying and moving pages For making the life of editors even easier when creating pages, we've added several items to the page menu and made the wording more consistent. There are three new menu commands: The Add subpage command lets you add a subpage to the current...

  • Scrivito 1.9.1 Release Notes

    This is a bugfix release. Bugfix This release makes widget and widget list menus on properties dialogs visible again, allowing you to add widgets to widget lists or move, copy, paste, or delete widgets in details views. Sorry for the inconvenience this bug might have caused. Please update your...

  • Scrivito 1.9.0 Release Notes

    Unified changes view modes When working on a page, Scrivito lets you compare the current page contents with the version you started off with. Up to now, the changes view that lets you do this had three modes, “Additions,” “Deletions,” and “All changes” of which – according to the feedback we...

  • Scrivito 1.8.1 Release Notes

    Bugfixes This is a bugfix release that solves two widget-related issues, and one referring to the Content Browser. Restoring a widget that originally had a direct subwidget (which was deleted) no longer causes an error.When restoring a widget, attributes that were originally empty are now...

  • Scrivito 1.8.0 Release Notes

    Improvements Content Browser The Content Browser is significantly faster now because it loads much more data in parallel. Just watch the main area while image thumbnails are being displayed! Also, the multi-selection mode is now directly accessible in the user interface. It lets you select...

  • Scrivito 1.7.0 Release Notes

    Improvements Rails 5.0 support This release of Scrivito adds support for Rails 5.0 to the SDK. Rails 5.0 was released this summer and includes numerous speed improvements, refactorings and new features (see the Rails 5.0 overview for details). Scrivito continues to support Rails 4.2, so in case...

  • Scrivito 1.4.3 and 1.5.4 Release Notes

    Bugfixes These releases make Scrivito compatible with jquery-ui-rails 6. On November 29, 2016, jquery-ui-rails 6 has been released. Unfortunately, Scrivito was incompatible with this new major version. Sorry to everyone who has been bitten by this. Please update your Gemfile and run...

  • Scrivito 1.6.0 Release Notes

    Improvements Introducing the sidebar Over the past months, as we added notification icons and the display size switch to the Scrivito panel, we realized that the panel has become too small to nicely accommodate any further controls. So we complemented it with a sidebar for better accessibility...

  • Scrivito 1.5.3 Release Notes

    Bugfixes This is a bugfix release that addresses an issue with <script> tags contained in html attributes that are edited in place: In Scrivito 1.5.0, we reimplemented how values are stored while content is edited in place. During this reimplementation, we also reworked the part that handles...

  • Scrivito 1.5.2 Release Notes

    Bugfixes This is another bugfix release. It fixes a minor issue regarding in-place editing: Scrivito's in-place editing interface now again stores HTML tags with missing attributes, e.g. <a>Link</a> or <img>. We're sorry for the inconvenience this bug might have caused. Please update your...

  • Scrivito 1.5.1 Release Notes

    Bugfixes This release fixes three bugs that were found in Scrivito's editing interface: The “Duplicate page” command caused the resulting new page to have the same path as the source page. Now, the duplicated CMS object shares the parent path of the source, but has a different and unique last...

  • Scrivito 1.5.0 Release Notes

    Improvements Specifying link targets Editors now have access to the target property of link and linklist fields, making it possible to specify whether a link should be opened in a new window. Note that your app needs to render this property for it to have an effect: link_to(link.display_title...

  • Scrivito 1.4.2 Release Notes

    Bugfixes No, you didn't miss the release of 1.4.1, but we had to skip this version for technical reasons. This release fixes a couple of bugs that were introduced in version 1.4.0 of the Scrivito SDK: You can now drag and drop files to the Content Browser again. Also, it is now possible again...

  • Scrivito 1.4.0 Release Notes

    Improvements Introducing the publishing history We are proud to present Scrivito's new publishing history to you! It gives you full control of what has been published in the recent past. No matter, whether you're just curious regarding the progress your site content made, or whether you need to...

  • Scrivito 1.3.1 Release Notes

    After the release of Scrivito 1.3.0, we encountered two small bugs we didn't want anybody to be annoyed of, so we simply fixed them. Sorry for the inconvenience updating might cause. Bugfixes We fixed a bug that caused drag and drop to be available in the "Changes" display modes. The page...

  • Scrivito 1.3.0 Release Notes

    Improvements Improved drag 'n' drop Dragging and dropping widgets in the Scrivito UI has become much smoother. Compared to the previous version: The drop target is detected more reliably. While dragging, the current structure of the widgets on the page doesn't change; the widgets don't hop...

  • Refined Image Cropping

    tl;dr: When cropping images using the image transformation option of the scrivito_image_tag helper, the new crop parameter now lets you specify the area of interest: left, right, top, bottom, or center. A little bit of history Starting at version 0.70.0 of the Scrivito SDK, images can be...

  • Scrivito 1.2.0 Release Notes

    Improvements Renaming files In editing mode, the files associated with binary attributes of CMS objects or widgets can now be renamed in the Content Browser if rendered in the details view using the scrivito_tag or scrivito_image_tag helper. To disallow renaming a file, set the...

  • Scrivito 1.1.1 Release Notes

    Bugfixes This release fixes a bug that showed up in version 1.1.0 of the Scrivito SDK in which freely customizable routing was introduced. The bug caused some permalinks ending with a 16 character word to produce a “Not found” error (404). We recommend updating your Scrivito SDK, even if you...

  • 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...

  • Scrivito 1.0.0 Release Notes

    No new features were added to Scrivito since version 0.90.0 was released. What does it mean for Scrivito to be 1.0? Breaking changes We finally removed the support for the scrivito_reload JS event we deprecated some time ago. Please refer to the release notes of version 0.40.0 for...

  • The Pages in the Attic

    For more than half a year now, the content of this website is maintained in place by Scrivito developers and me. This ensures that all of our experience with editing content in place flows back into the application design and development process, which is, of course, extremely helpful if you...