show CKK imagefield in bubble

franskuipers - April 9, 2008 - 11:17
Project:Timeline
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

I needed to show the CCK imagefield of a node into the bubble. This patch is doing just that. But the code needs some review. I don't know if this is the most efficient method to do it.
What I do now is:

  • test if there are CCK fields in this node type
  • if yes, is the field type image?
  • if yes, give the image to the timeline api

Only the first found image is displayed, no size adjustments are made.

I have tried to do it with adding the imagefield into the fields of views, but the $view->fields('queryname') is not returned in the 'item' array.

AttachmentSize
timeline-image-1.patch2.42 KB

#1

somnoliento - June 3, 2008 - 07:25
Status:needs review» needs work

The patch works, but there should be a way to do this without running directly the SQL commands.

I spent a couple of hours trying to come up with a cleaner solution; these are some of the things I tried (all in the function timeline_data):

If I add the CCK imagefield into the view, I get the 'fid' number (file id) in the bubble instead of the image. It should be possible to run content_format:

<?php
  $body_value
= content_format('field_theimage',$node->field_theimage[0],'theimagehandler')
?>

which gives you the image, formatted according to the handler you specify. However, I haven't figured out a clean way to get just the field name (content_format's first parameter) from $view->field.

Another idea is to use node_view:

<?php
  $node
->teaser = node_view($node,$teasers,FALSE,$links);
?>

This formats the node as a teaser, and displays it in the bubble as part of the $body_value. In this case, the view should only have two fields, and the event title appears twice (which can be fixed with CSS).

I thought I'd toss these ideas to see if we could come up with a more efficient way to handle imagefields in the timeline.

AttachmentSize
timeline.node_teaser_in_bubble.patch 963 bytes

#2

jmiccolis - September 13, 2008 - 02:03
Version:5.x-1.x-dev» HEAD
Status:needs work» fixed

For Drupal 6 I've moved to an entirely views based model, and allowed for any number of fields to be displayed in the bubble. To display an imagefield you'll simply need to add the imagefield to the view.

I'm changing the version of this issue to HEAD and setting the status to 'fixed'. I don't have any plans to push theses changes back down into the Drupal 5 branch.

#3

Anonymous (not verified) - September 27, 2008 - 02:11
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#4

emersonlenon - January 20, 2009 - 13:45
Status:closed» active

Can we open this thread?
I don't have the option to upgrade to version 6 due to some other modules I am using and I would love to see more work done on getting cck fields into the timeline bubble.

Frans,
Do you think there is a way to do this, building on your patch and somnoliento's?
I can help if need be.

#5

cglusky - January 21, 2009 - 17:59
Version:HEAD» 5.x-1.x-dev
Status:active» needs work

If we are going to reopen this then moving this back to D5 version and the status of the patch in #1.

#6

xamanu - August 18, 2009 - 02:37
Status:needs work» won't fix

This issue seems to be completely inactive. And there is no maintainer for the D5 version anymore. I'm not willing to support the D5 version, sorry. Please try newest version of timeline.

 
 

Drupal is a registered trademark of Dries Buytaert.