For now I just disabled support for imagefields as icons. I haven't had an eye on this. But it might be connected in a similar way what KarenS points out for date field and views: #1199970: Date field handling works differently in D7

CommentFileSizeAuthor
#3 icons_in_timeline-0.1.patch8.25 KBimmoreel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

romansta’s picture

Title: D7 port: Imagefield support » D7 port: Image support

I need this feature, but I'm not a module developer. I know, that imagecache/imagefield are merged in image and 'presets' are now called 'styles'.

I renamed imagefield.inc in image.inc and added "files[] = plugins/image_sources/image.inc" to the timeline.info.

The code for the styles in timeline_view_plugin.inc works:

      if (module_exists('image')) {
        $image_styles = array('' => t('Orginal image size'));
        foreach (image_styles() as $style) {
          $image_styles[$style['name']] = $style['name'];
        }
        $form['fields']['advanced']['image_icon'] = array(
          '#type' => 'select',
          '#title' => t('image style for Icon'),
          '#options' => $image_styles,
          '#default_value' => $this->options['fields']['advanced']['image_icon'],
        );

But I can't see the icon options. Should be something like this, I guess, but this doesn't work::

        foreach ($image_sources as $image_source) {
          if (get_class($handler) == $image_source['handler_name']) {
            if ($field_info['type'] == $image_source['field_type']) {
            $iconimage_field_names[$field] = $field_names[$field];
            }
          }
	}

At last, the path in image(field).inc is wrong.

Any Idea?

romansta’s picture

Now the icon option in the views-backend is also visible.

Changed this in timeline_view_plugin.inc (similar to the date field above) :

        foreach ($image_sources as $image_source) {
          if (get_class($handler) == $image_source['handler_name']) {
            if ($field_info['type'] == $image_source['field_type']) {
            $iconimage_field_names[$field] = $field_names[$field];
            }
          }
    }

Changed this in image(field).inc :

$plugin = array(
  'name' => t('Image field'),
  'callback' => 'timeline_image_source_image_path',
  'handler_name' => 'views_handler_field_field',
  'field_type' => 'image',
);

The path in image(field).inc is still wrong.

immoreel’s picture

FileSize
8.25 KB

Hey,

We created a patch to enable image support in timeline.