Imagefield

Events happening in the community are now at Drupal community events on www.drupal.org.
njt1982's picture

Firstly, hi all in this group...

A little background from me - I've been programming websites for a few years and recently had a chance to meet Rob Douglass through my work. My eyes have been fully opened to Drupal and its potential! Before drupal I coded sites by hand as I always believed CMS's to be restrictive and blubbery. Although drupal isn't particularly lightweight, its certainly not restrictive. My first (personal) project was to create a challenge database for a forum I regularly attend... This produced DBP-Site. I learned a lot from this such as a code highlighting module which, at some point, I'm going to progress and submit to the module base here (it should work as a more generic highlighter too).

Next site would be Thingy Ma Jig! I decided to cease my efforts on my "version 2" Thingy Ma Jig site and instead focus on getting it into Drupal. There is also the origional TMJ site which ceased development years ago. I appologise profoundly for using tables for layout... Forgive me as I did not know my sins ;-)

I have a few projects (many more I want to put on there) and one of the features I want is a screenshots field. I've been paying attention to the Imagefield thats in development. Its showing HUGE potential and I was playing about with it last night. I'm trying to work on a screenshot/thumbnail feature which its currently lacking (or so it seems).

Basically, I'm trying to replicate the project side of my ThingyMaJig site and that requires a screenshots section which has thumbnails to click on which show the larger shot. I have the thumbnails and can add links easily through the theme, however I'm currently having difficulty creating a "screenshot" node. I tried adding the following to the menu hook...

<?php
$items
[] = array(
 
'path' => 'screenshot/'.$filename,
 
'title' => t('file screenshot'),
 
'callback' => '_imagefield_node_preview',
 
'access' => TRUE,
 
'type' => MENU_CALLBACK
);
?>

and I have now got that working... For example, if the image is site.com/system/files/ss_00.png then for the full screenshot node, I'd like site.com/screenshot/system/files/ss_00.png. This bit seems to work!

Next... I create the node_preview function for the callback. As a quick test (this was at midnight last night and I have to get up at 7am for work), I just chucked this into the function...

<?php
  $node
= new stdClass();
 
$node->body = "Test!!";
 
$node->label = '';
 
$node->description = '';
 
$node->help = '';
 
$node->title_label = 'Title';
  return
$node;
?>

Unfortunately, this returned a themed page with the words "Object #2" in the contents section! After speaking with Rob, I was informed that it might be that the function required HTML to be returned, not an object. When I get home I'll try returning theme('node', $node)...

Has anyone else played with the image field yet?

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: