Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am developing a slideshow that shows nodes with views_slideshows embedded in them with views_attach. Having some issues with the 2.x branch and the singleframe plugin so trying out the 3.x branch. I see that if you have a node row type that you lose the pager option. I gather this is because it uses fields for pagers and with nodes, you have not fields for the pagers.
My question is, as you can now make your own pagers, if I made one, could I get around the fields issue, or should am best to just head down a different avenue so to speak. Thanks,
Comments
Comment #1
redndahead CreditAttribution: redndahead commentedNode display currently has issues in 3.x. I'll need to look into this further.
Comment #2
maddentim CreditAttribution: maddentim commentedI ended up making what I needed out of the 2.x branch. The 3.x branch does look promising and will look at it for future projects. Thanks.
Comment #3
ultimateboy CreditAttribution: ultimateboy commentedI'm definitely looking for this functionality as well. I'd love to be able to use views_slideshows with node display instead of field, but the lack of a pager is a game stopper. I think what makes the most sense is to create a new pager for views that use "content" instead of "fields" which uses the node title by default. I started to try to get this to work, but I'm definitely stuck.
I've added a new widget to
hook_views_slideshow_widget_pager_info()
, added an entry tohook_theme
with the same name, and began writing the preprocess code to add the titles. I thought I could get tricky and try to simply emulate exactly what$rendered_fields .= theme('views_slideshow_pager_field_field', array('view' => $vars['view'], 'field' => $field, 'count' => $count));
from_views_slideshow_preprocess_views_slideshow_pager_fields()
does by hardcoding the divs. I ended up with something like this:This actually all appears to work, sort of - the titles get displayed as pager items, and all is well and good... but the JS doesnt fire. Clicking on the titles simply takes you to the node itself and doesnt advance the slideshow. I feel like I'm missing something pretty obvious here, but I cant seem to figure out what it is. Any chance you could give me a hint of how the JS functions and what might be stopping the above from functioning correctly?
Comment #4
ultimateboy CreditAttribution: ultimateboy commentedFinally figured it out. The JS was getting hung up on
if (Drupal.settings.viewsSlideshowPagerFields[uniqueID][location].activatePauseOnHover) {
because I wasnt including the activePauseOnHover setting in my preprocess...If you like the general approach, I'll submit a patch.. it feels a tad hackish and I don't even want to think what happens if you try to build a slideshow out of non-node entities, I'd assume this approach would fail beyond belief.
Comment #5
headstartcms CreditAttribution: headstartcms commentedI have problem with the slideshow module it doesn't appear on the block. All modules are already installed yet i cannot find the slideshow module. How does this module work ?
Comment #6
ultimateboy CreditAttribution: ultimateboy commentedJazclick, it's probably best for you to create a new issue with things like this instead of extending this one which is about a very specific feature request to the module.
Views slideshow, works, as the name would suggest, with the views module. It provides a display type to display the results of a view in a slideshow. I encourage you to watch some of the many screencasts out there on using views and/or specifically about views slideshows. Thanks!
Comment #7
longwaveI made a simple module that implements a numbered pager for node displays and uploaded it to a sandbox: http://drupal.org/sandbox/longwave/1340916
Comment #8
longwaveImproving title.
Comment #9
liebezeit CreditAttribution: liebezeit commentedlongwave, your code doesn't work if the "hide if there is one slide" checkbox is checked.
Comment #10
longwaveThat's why it's in a sandbox ;) It's only been briefly tested and works for my use case but probably not with many of the myriad of options that Views Slideshow offers.
You can post issues against the sandbox at http://drupal.org/project/issues/1340916
Comment #11
jason.fisher CreditAttribution: jason.fisher commentedFollowing..
Comment #12
anthonyR CreditAttribution: anthonyR commentedThanks for this sandbox. I'm using it right now :)
Comment #13
Simon Georges CreditAttribution: Simon Georges commentedThanks for the sandbox, I'm using it (and it works). +1 for a patch to Views Slideshow core module!
Comment #14
mstrelan CreditAttribution: mstrelan commented+1 on the sandbox project being awesome.
+1 on #9 re: hiding if one slide is broken
To fix #9 just change the && to || in
if (empty($vars['settings']['hide_on_single_slide']) && count($vars['view']->result) > 1) {
This is the same problem views_slideshow had recently and has recently been fixed.
Comment #15
gthing CreditAttribution: gthing commentedI enabled the sandbox module, and can now enable the pager in the slideshow settings. However, the only option for "pager type" is "simple counter." So for my five slides, I can see the numbers 1-5, but I can't click on them to jump to that slide. What am I doing wrong?
Comment #16
broonSo finally, I am on a project where I need a Views Slideshow. And I need a pager for display type "Content".
I installed the sandbox module from #7 and fixed the issue from #9 with comment #14.
Now, In encountered the same thing as gthing, it's nice to finally have a pager, but it's not clickable, thus it's not really useful yet. I was going through the module files of both Views Slideshow and Views Slideshow Simple Pager and finally came up with this one line solution (it's a long line, though):
Add the following at the end of the file
views_slideshow_simple_pager.module
right after the drupal_add_js(..) (line 44):Note that this code is for a bottom pager, replace bottom with top if your pager is at top position.
Comment #17
jenlamptonThe solution above did not work for me, but adding anchor tags to the fields output seemed to do the trick. Patch offered on the sandbox at http://drupal.org/node/1631782#comment-6111594
Comment #18
anthonyR CreditAttribution: anthonyR commentedI did what @jenlampton did as well. The controls' markup can be overridden (see views_slideshow templates) and you can transform them in A tags which makes them clickable and focusable.
Comment #19
klonos+1 for a patch (or submodule perhaps?) in the views_slideshow project. I'm using Views Slideshow Simple Pager sandbox too (+ the patch from #1631782: Allow pager to be clickable) for now ;)
Comment #20
webadpro CreditAttribution: webadpro commentedViews Slideshow Simple Pager's code should be added into this module.
Comment #21
Alex Andrascu CreditAttribution: Alex Andrascu commentedAny news about this ?
Comment #22
donquixote CreditAttribution: donquixote commented+1, I am very interested in this.
Comment #23
headstartcms CreditAttribution: headstartcms commentedThanks for the response!
Comment #24
Kristi Wachter CreditAttribution: Kristi Wachter commentedCan we consider this RTBC, since several users have reported using the sandbox module with good results?
Comment #25
iLLin CreditAttribution: iLLin commentedA simple fix for anyone that is interested, put this in your custom node template.
This will populate the content array for you.
Comment #26
aaron CreditAttribution: aaron commentedNothing to commit.
Comment #27
vbouchetI also faced this issue for a customer and I developed a module to render entities in the pager. I based this module on Views Slideshow Simple Pager.
Comment #31
NickDickinsonWildeComment #33
NickDickinsonWildeThanks to Longwave for creating this, and to Jen Lampton, Anniegreens and bleen for the patch in #1631782: Allow pager to be clickable. Now merged in - with some default styling as well.