Jump to:
| Project: | Views carousel |
| Version: | 6.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | joeebel |
| Status: | active |
Issue Summary
I have an application for Views Carousel where I want the items in the carousel to be displayed with a start index (item first displayed on left) to vary with the page loaded. This site is for a musician and the view has several attachments. The idea is to display the carousel at the top of the page with images of the CDs in it. Underneath that is the general info about the CD, followed by an audio player with a playlist based on songs on the CD. Following that is a list of the songs, all referencing an anchor to the lyrics for those songs. The lyrics are all listed in song order underneath the songlist.
There are several content types at work here. One is the Song Info type (node) which includes the lyrics and copyright info of each song. Another is the CD Info (node) type which gives the general info and has an image attached. (This image is used in the carousel.) Another is an Audio type where the samples are uploaded as nodes with type 'Audio'.
All of these content types have a single taxonomy item from the CD vocabulary which simply states which CD this piece of content belongs to.
The images in the carousel use a custom field to find the taxonomy ID to link the rest of the content. When clicked, the taxonomy ID is appended to the URL, e.g., jsm.cottageparkrentals.com/cdview/2, and this brings up the content with a page refresh.
My problem is, the carousel only displays four items. If I scroll to the right to see items >4, if it is clicked, the carousel, after the new page is loaded, snaps back to item one and the image for the page we are now on is out of view. I need the behavoir of the carousel to respond to the page we're on so as not to scroll the current page's image out of view. How can I do this? How do I override the jCarousel script for just the cdview pages?
I am pretty much a noob at this, but I got this far already! Check out http://jsm.cottageparkrentals.com/cdviews for a snapshot of a work in progress. Click on the first image on the left (Gravity of Grace) for the view with the most content. The audio player does not yet fetch the samples, but I know I can get that working later. Not all the content is in for all the CDs, but you'll get the idea. Then, scroll the carousel to the right and click on the last image. When the page refreshes, the carousel re-indexes back to the start. (No sir, I don't like it...)
Thanks in advance for any help. Let me know if this is too unclear to figure out and I'll take another stab at more clarity.
Comments
#1
It really would be useful to dynamically offset the carousel for using it as an image menu or something like that. (I brought the question up in this thread http://drupal.org/node/420874 and here http://cssbeauty.com/skillshare/discussion/3098/tricky-jcarousel-question/ is a solution that propably could be somehow integrated into views carousel.)
#2
New link to that page:
http://jsm.cottageparkrentals.com/cdview/Gravity%20Of%20Grace
#3
subscribing!
#4
I've got exactly the same request. You can see my project using Views Carousel here:
http://www.onceuponacake.com.au/content/bouquet-green-wrapper
I'd love for the carousel to start on, or have centred in the wrapper, the image representing the currently selected node.
No idea where to start though! I have a feeling it would be... complicated!
I thought perhaps it might be possible by coming at it from another angle, like reloading the node information via AJAX only for the 'content' area. This would preserve the current status of the carousel - ie, where you have already navigated to.
#5
Maybe this patch:
#629122: Node aware start index
could do something for you.
Hope it helps.
Cheers
LeMartialou
#6
If you add the following to your template.php file (replacing your_theme with the right theme name), you can pass any settings in the URL. So sending "my.site.com/carousel?start=2" would start it on the second item. You could do the same with "offset".
/* Override ViewsCarousel function to permit variables to be inserted from $_GET */
function your_theme_viewscarousel_view($view, $options = array(), $rows = array()) {
// Remove the skin and skin path from the options.
$skin = $options['skin'];
$path = ($skin == 'custom') ? $options['skin_path'] : NULL;
unset($options['skin'], $options['skin_path']);
// Remove any empty options and convert any numbers to float values.
foreach ($options as $key => $value) {
// Override so that URL variables can provide settings
if (isset($_GET[$key]) && is_numeric($_GET[$key])) {
$options[$key] = (float)$_GET[$key];
}
elseif (is_numeric($value)) {
$options[$key] = (float)$value;
}
if (empty($value)) {
unset($options[$key]);
}
}
// Use jCarousel to create the carousel.
return theme('jcarousel', $rows, $options, $skin, $path, 'viewscarousel-'. $view->name .'-'. $view->current_display);
}