Accessing S5 view of a CCK field in Drupal 6

mercurio - September 12, 2008 - 03:41
Project:S5 presentation player
Version:6.x-1.x-dev
Component:Code - s5_textfield
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm trying to replicate what's shown in the second half of the screencast, in Drupal 6. I have
a CCK field called "presentation" that contains an S5 presentation, and a body with text.
The url .../node/43/s5 displays the body as an S5 presentation, as would be expected, but
the url .../node/43/s5/field_presentation still displays the body, not the contents of the presentation
field. Has anyone gotten this to work in Drupal 6?

#1

greggles - September 12, 2008 - 16:14
Category:support request» bug report

I haven't done any testing for D6 with cck - basically because cck still changes every day. Once we have a cck 2.0 please ping me about this issue and I'll see what I can do.

#2

mercurio - September 16, 2008 - 00:41

I added the following code to my s5/s5_textfield.module, in s5_textfield_nodeapi() (line 175):

<?php
   
else if (isset($node->field_s5_presentation[0]['value'])) { // PJM hack to support s5_presentation CCK field
     
_s5_textfield_nodeapi($node,
                     
$node->field_s5_presentation[0]['value'],
                     
$node->teaser, $op, $teaser, $page);
    } 
?>

That's enough to make a CCK field called s5_presentation override the body if it's present, otherwise
the body is used. A quick hack like this might be sufficient to handle most cases when the site
builder wants a field other than the body to be used for the presentation.

#3

greggles - September 16, 2008 - 02:51

There is code which is supposed to figure out which field to deal with based upon the URL. so something like example.com/node/NID/s5_field_s5_presentation would be the url for your cck field name.

Again, I imagine that cck for 6.x has changed enough to break that, but if you want to hack the module that's where to look ;)

 
 

Drupal is a registered trademark of Dries Buytaert.