If you want to deploy a timeline powered view by exporting as a default view, in a .views_default.inc file in your module, right now, you (generally) get a broken view.

There's two reason for that:

  • There's a few places in the code using the deprecated $view->style_options, instead of $view->style_plugin->options. That matters because when the view is exported $view->style_options only contains values that the user changed from the provided default, which means that if the user left the default width and height, then those informations are not in ->style_options, and the timeline is drawn in a 0x0 div, which is a bit small
  • A few options where added to the option_form, but are not mentionned in option_definition, namely band1_unit_width, band2_unit_width and focus_custom. This means that they can't be exported.

Attaching a patch to fix that.

CommentFileSizeAuthor
#1 1860370-1-exported-timeline.patch8.07 KBDeFr

Comments

DeFr’s picture

Status: Active » Needs review
StatusFileSize
new8.07 KB

Note: The default value of 50 for band1_unit_width and band2_unit_width is somewhat arbitrary, but it seems to be the smallest value that gets the "day" unit to fit in the column. Given that day is the default value for unit 1, that seems to make sense as a default value.