Thanks for your brilliant module, I am using it for a little website of a Dj friend of mine. I am not very skilled with php but I am learning as I do more and more drupal. I would like to know how to do multiple nodecarousel nodes (in different pages) but with different theming too. I have been trying to do it the whole evening and I have not had any success.
function dw001_nodecarousel_node($node, $name='') {
if ($name='wowcar') {
$content = '<div class="node-carousel-item">';
$node = node_build_content($node, TRUE, FALSE);
$content .= '<div class="hidden nid">'. $node->nid .'</div>';
$content .= '<div class="cartext">'. check_markup($node->field_wow_text[0]['value'], 'node/'. $node->nid) .'</div>';
$content .= '<div class="cartitle"><h3>'. $node->title .'</h3></div>';
$content .= '<div class="carimage"><img src="'.$site_url.'/sites/all/files/imagecache/news_img/images/clients_logos/'. $node->field_wow_image[0]['filename'] .'" alt="'.$node->title.'" /></div>';
$content .= '</div>';
return $content;
}
else if ($name='nowcar') {
// now we define the news of warb AKA now carousel
$content = '<div class="node-carousel-item">';
$node = node_build_content($node, TRUE, FALSE);
$content .= '<div class="hidden nid">'. $node->nid .'</div>';
$content .= '<div class="cartitle"><h3>'. $node->title .'</h3></div>';
$content .= '<div class="carimage"><img src="'.$site_url.'/sites/all/files/imagecache/news_img/images/clients_logos/'. $node->field_wow_image[0]['filename'] .'" alt="'.$node->title.'" /></div>';
$content .= '<div class="cartext">'. check_markup($node->field_wow_text[0]['value'], 'node/'. $node->nid) .'</div>';
$content .= '</div>';
return $content;
}
}
I thought this would be the easy way of doing it, but it doesn't seem to work...I have tried duplicating the function and changing the name but that wouldn't load at all. I realise that this is some basic stuff that I should know already, I would be really pleased if someone could help me out with this one.
I was thinking of doing a use case of this project because is a transformation from a flash site to a Drupal CMS powered site, keeping my DJ friend happy about the interaction (in his world) and the appearance (in his world). Maybe I could make a video screen-cast of the implementations of the nodecarousel in the website. But before that I would really appreciate if someone could help me mastering it.
for a look at the project: http://theinfotree.co.uk
Thanks,
leenyx
Comments
Comment #1
leenyx commentedNevermind, 1 hour and 10 minutes after the post above (2:50am), I couldn't sleep with this problem and I think I have a solution that works...
As I said before no PHP experience, but I have tried with my little resources to use a switch (loop?)...
Please correct me if you know a better, more elegant solution or if I am using something wrong but this works for me...
Thanks,
Leenyx
Comment #2
jcfiala commentedJust glancing across it, looks good to me, and if it's working for you that's great!