Hi there-

I've been messing with this module for few days now, and I have no idea how to make it work. I've read and re-read the README for nodecarousel and jcarousel multiple times and I still have no idea how to get a working carousel in my content region.

I thought I read that if I set up a node queue it would make it easier to theme the node carousel... but I can't even get a working carousel on my page to even start theming. Here's some questions that are not answered in the documentation:

• Do I need to put the node queue in a views block? If so, does it need to be a list view?

• How do I theme this carousel? How do I specify the jcarousel tango theme to get started?

• Do I need to add a javascript call to get this carousel to show up? If so, what is it and where does it go (template.php, page.tpl.php)?

• You mention overriding theme_nodecarousel. How is this done? If I copy the old function to make minor changes to, where does it go (template.php, page.tpl.php)? What are the functions I need to theme the carousel?

I've seen examples of this module in action and i think it's really great! I would really love it if I could get it on my own site too! Any help would be GREATLY appreciated.

Thanks a lot!

Comments

dogboy72’s picture

If you've set it up you should see your carousel as a choice on the blocks page in your admin section. I haven't played with it much yet, but I would imagine you could theme it the same way you would theme other module blocks. There is lots of documentation on how to do that.

Good luck!

jcfiala’s picture

That's an awful good question - unfortunately I've been soaking in it so much that I'm not noticing how hard it is to use!

So!

I'm going to work on some sort of a tutorial to do up to try and help. I'll let you know when I've completed it, and then you can tell me if it's still a problem...

spas’s picture

Priority: Normal » Critical

Hi John,

such tutorial is greatly needed for sure and a lot of people will be very thankful - and me myself.

My request is if you have anything ready from tutorial to share it.

I'm trying to repeat what you did with Touts and Galleries on popsci.com, but it's hard.
Could you please make full analysis of this two cases?

Thank you in advance.

chlobe’s picture

subscribing

aaron stanush’s picture

+1 on tflmike's first point:

Nodecarousels only seem to be made available as blocks, so how is PopSci.com displaying them as what seems to be a node?

ex. http://www.popsci.com/gear-gadgets/gallery/2008-03/goods-work-home

Or is this still a block, placed inside some other node or perhaps a panel?

sedat44’s picture

subscribing

jcfiala’s picture

They're very much a block - it's displaying there in the 'content' area, using the settings on the blocks page to only show up on certain pages, IIRC. (I don't have the code on hand.)

Using it inside of a panel would probably work just fine though - I hadn't really tried out panels when we were developing that site.

kvoelker’s picture

subscribing

bflora’s picture

yes, more directions would be appreciated. I have no clue what exactly you're referring to with "an override" and don't understand how jcarousel and nodecarousel are supposed to interact. I could devote the next 6 hours to trying out various permutations...but that sucks pretty hard.

The module sounds great....i just wish I knew how to actually use it.

I thought that if I made a nodecarousel, it would magically appear in my list of blocks....but I see no nodecarousel....not sure what to do next.

jcfiala’s picture

"I thought that if I made a nodecarousel, it would magically appear in my list of blocks....but I see no nodecarousel....not sure what to do next."

Ah - someone else had that problem, and it turns out he expected the name of the nodecarousel to show up in the blocks page, when it was the description. Try setting the description of the nodecarousel to something unique, and then looking for it on the blocks page. It really should show up.

And yes, I'm seriously intending to soon write up a nice handbook page that takes you step by step through setting up a nodecarousel. But I've had health issues, and it got pushed back.

bartekg’s picture

Subscribing.

BTW: I believe what most of us is missing is a sample node theme function showing how to render image with title and/or description (as used on popsci.com).

Cheers,
Bartek

jcfiala’s picture

Here's a sample theme_nodecarousel_node function, from my testbed (Drupal 5) code:

function phptemplate_nodecarousel_node($node, $name='') {
  if ($name == 'test_access_view') {
    return theme_nodecarousel_node($node, $name);
  }
  if ($node->type == 'image') {

    $content = '<div class="node-carousel-item">';

    $content .= theme('imagecache', 'thumbnail', $node->field_image[0]['filepath']);
    $content .= '<div class="node-carousel-title node-carousel-label">'. l($node->title, 'node/'. $node->nid) .'</div>';
    $content .= '<div class="hidden nid">'. $node->nid .'</div>';
    $content .= '<span>'. $node->nc_position .' of '. $node->nc_total .'</span>';

    $content .= '</div>';
  }
  elseif ($node->type == 'info') {
    //print_r($node);
    $content = '<div class="node-carousel-item" style="width: 175px">';

    $content .= theme('imagecache', 'thumbnail', $node->field_image[0]['filepath']);
    $content .= '<div class="node-carousel-title node-carousel-label">'. l($node->title, 'node/'. $node->nid) .'</div>';
    $content .= '<div class="hidden nid">'. $node->nid .'</div>';

    $content .= '</div>';
  }
  elseif ($node->type == 'blog') {
    //$content = node_view($node, TRUE);
    $content = '<div class="node-carousel-item">';

    $content .= '<div class="node-carousel-title node-carousel-label">'. l($node->title, 'node/'. $node->nid) .'</div>';
    $content .= '<div class="hidden nid">'. $node->nid .'</div>';
    $node_words = explode(' ', $node->title);
    $content .= '<div class="hidden node-carousel-index">'. $node_words[0] .'</div>';

    $content .= '</div>';
  }

  return $content;
}

Some notes: The node type of 'image' is a CCK type I built using imagefield, and you can see where I'm using imagecache to present it - I think the 'thumbnail' imagecache preset resizes the image to 75x75. You can also see where I'm listing the 'X of Y' under each node, so you know where in the queue you are. The 'info' type also has an imagefield, and the 'blog' is the standard blog type. You can see in the blog where I'm setting up a 'node-carousel-index' field so that I can have an index under the carousel, letting me to jump from item to item by clicking on the name in that field.

Usually I don't switch on $node->type, I usually switch on the $name parameter, which is the name of the nodecarousel which is causing the theme function.

Usually this would go into the template.php file for your theme, although in this case I'm keeping it in testbed.module.

Does that help?

omnyx’s picture

And yes, I'm seriously intending to soon write up a nice handbook page that takes you step by step through setting up a nodecarousel. But I've had health issues, and it got pushed back.

+1 for this. A handbook with a worked out example would be amazing!

bartekg’s picture

@jcfiala: I am really busy these days so unfortunatelly I cannot test your code. However it has already answered a few questions so I believe I should be able to get it working. I will let you know how it goes when I have a chance to try it.

Thanks a lot for your help.

roopletheme’s picture

It's hardly handbook-worthy, but I posted a few notes about how I got things working in this thread. Hope it helps somebody.

hans59’s picture

Title: How do I get this to work? » 6.1 shows no image (to me)
Version: 5.x-1.0 » 6.x-1.x-dev
Assigned: Unassigned » hans59
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

First let me say: congratulations for that wonderful modul and the talents and gifts which make something like that possible.

i tried for two days to get images to the (working) module under 6.1. dev. Now i (have to) give up. Tried everything i found on information, which is basicly for the 5.x. version.

For i am not a php-crack - can anybody give me an idea how to write the code for the template.php to bring the thumbnails instead of the node-titles to the carousel.

i have a carousel build on taxonomy. Now i don't find a variable to define and call the images. for there is no support with the views-module in the 6.1. i am very curious to get to know how it could be done. All 5.x-solutions are based on a cck-field which is easy to grasp.

my source-definition: node type/taxonomy/ - Node types: image / - taxonomy terms: Image gallery/ - rest is selfexplaining.

my carousel : http://develop.koehl-media.de/content/the-mess

i stopped working on the php-code, so now there is the default again.

i read in the cvs, that the module tries to find an image as default. but i think that doesn't work (at least for me).

maybe it would be a good idea to provide a code that automatically creates the php-code to provide the view of the carousel (just like views wizzard) - for dummys like me.

if someone can help me i would be very grateful and happy 'cause i love the module and the resulting possibilities.

A little tutorial would be helpful.

Thanx a lot

Hans

jcfiala’s picture

Well, what are you using for images? The Image module? I'm going to assume so, since that's the most mature solution for D6.

Try putting this in your template.php for your theme - I'm assuming a name of exampletheme:

exampletheme_nodecarousel_node($node, $name) {
    $content = '<div class="node-carousel-item">';
    $content .= image_display($node, IMAGE_THUMBNAIL);
    $content .= '<div class="node-carousel-link">'. l($node->link_title, $node->link_url) .'</div>';
    $content .= '</div>';
}

Now, that assumes that the $node is the image node itself - if it's another node and you're using image_attach to pull in an image from a different node, then you'll want to do something more like this:

exampletheme_nodecarousel_node($node, $name) {
    $content = '<div class="node-carousel-item">';
    $image_node = node_load($node->iid);
    $content .= image_display($image_node, IMAGE_THUMBNAIL);
    $content .= '<div class="node-carousel-link">'. l($node->link_title, $node->link_url) .'</div>';
    $content .= '</div>';
}

The real problem with generically handling images is that there's so many different ways of handling them - and it's a problem I'm still wrestling with.

hans59’s picture

thank you very much. version 1 brought the thumbs to life! You are right - i used the image- (image import) module to load the images .

Now there is one more little problem: the link to the original images on the thumbnails doesn't work. i guess it is my lack of php-knowledge. but if you don't mind to get me the code for the href you make my weekend.

the code on template.php is yours (1st. version)

function news_nodecarousel_node($node, $name='') {
  $content = '<div class="node-carousel-item">';
  $content .= '<div class="node-carousel-title node-carousel-label">'. l($node->title, 'node/'. $node->nid) .'</div>';
  
   $content .= '<div class="hidden nid">'. $node->nid .'</div>';
  $content .= image_display ($node, IMAGE_THUMBNAIL);
  $content .= '<div class="node-carousel-link">'. l($node->title, $node->link_url) .'</div>';
  
  $node_words = explode(' ', $node->title);
  $content .= '<div class="hidden node-carousel-index">'. $node_words[0] .'</div>';

  $content .= '</div>';
  return $content;
}

nodecarousel.module is on default

http://develop.koehl-media.de/content/slide

Thank you for your kind support.

P.S. I bought myself a php-tutorial!!!!!!!!!!!

jcfiala’s picture

You want to click on the image to go to the node? Not that hard... just replace

$content .= image_display ($node, IMAGE_THUMBNAIL);

with

$content .= l(image_display ($node, IMAGE_THUMBNAIL), 'node/'. $node->nid, array('html' => TRUE));
hans59’s picture

Status: Postponed (maintainer needs more info) » Fixed
greenskunk’s picture

Subscribing

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

nravens’s picture

I would like to click on the thumbnail to link to the node. How do I get this to work with Drupal 5?...

I have the carousel displaying with this added to template.php:

function phptemplate_nodecarousel_node($node, $name) {
$content = '

';
return $content;
}

But I would like to link to the node when clicking on the thumbnail.

I tried adding what you said in comment #19 but I assume that only works with Drupal 6? because it didn't return the desired result.

nravens’s picture

Status: Closed (fixed) » Active

Also, how would I get a nice background to the carousel?

Something like:
http://sorgalla.com/projects/jcarousel/examples/dynamic_ajax.html

jcfiala’s picture

Hey - this item's closed. Please bring up issues as a new ticket.

ultimateboy’s picture

Status: Active » Closed (fixed)

See #25. There are way too many issues in this issue.. create new ones if there are still problems. Thanks!