Hello, I just upgraded slideshow from 6.x.2.x and was wondering if there is a way to have a numbered pager control in 6.x.3.x for the slideshow. Right now all I am capable of doing is inserting the pager control that uses one of the fields as pager link text - like the node title. Is there a way to somehow create the pager so that the pager text corresponds to the number of the slide in the in the query result? I have ten slides in the slideshow and I would like to have ten links numbered 1-10. I could then style the links to look like buttons. Right now I'm stuck using the previous pause next controls...

Wouldn't it make sense to make this the default behavior of the pager control?

CommentFileSizeAuthor
#14 Views Slideshow options307.75 KBchowdah
#13 hpa-slides-pager-1.jpg101.59 KBmattys
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

samwillc’s picture

Hi,

I'm trying to work out the same thing!

Adding a field 'Global: View result counter' gets you the numbers. Not got as far as what do do with them next. I cant get the pager working at all.

Got 3 slides, end up with 3 links under which each link to the slide content type nodes so clicking on them takes a user away from the homepage and to the slider content type page rather than actually changing the slide?! Not quite what I had in mind.

Sam.

samwillc’s picture

Solved this if you're interested, I used views result counter, and outputted that as a link "#slider".

This makes it a 'fake' link, but at least it looks like a link unlike the paging I had before! Set pager to use field 'views counter' and you're done.

I rewrote the field to wrap a span around [counter] as I displace the text via css and use a background image instead, like so:

/* ==========SLIDESHOW CSS STYLES========== */

.views-content-counter a {
display: block;
float: left;
margin-right: 20px;
height: 25px;
width: 25px;
background: url(../images/pager-bg.png);
background-position: 0px 0px;
}

.views-content-counter a:hover {
background-position: -25px 0px;
}

.active .views-content-counter a{
background-position: -25px 0px;
}

Hope this helps.

Sam.

chowdah’s picture

Thanks for this samwillc, I had gotten as far as using the global 'Global: View result counter' previously, but had bailed on the idea because I could not get the numbers to display as links that would scroll through the slides. The trick of using the #slider anchor as the link worked awesome!

Do you have any idea why this worked?

samwillc’s picture

Hi chowdah,

I thought my slider wasn't working until I clicked the numbers and the slides changed! Turns out, the 'links' aren't actually links at all so of course, the cursor stays as an arrow which is completely misleading for a user, how would they know to click on plain text?

That's why I put a fake anchor link on them (could put anything after the #, but # on its own is not allowed so I just put #slider). Just makes them more obvious as links and the ability to style them out easier. The links work without the anchor but they are just plain text without it.

I did this just make the pager 'clickable'.

Hope this helps.

Sam.

chowdah’s picture

In the 6.x.2.x version, you would roll over the button to make the corresponding slide the active one. I had mine set up so that clicking the button would actually open the node. If I could figure out how to do that with 6.x.3.x, I'd be thrilled.

samwillc’s picture

Hi chowdah,

So you use the pager as hovering on it changes the slide and clicking on it goes to the node? I'm sure it can be done but it's an unusual funtionality, I certainly wouldn't expect that. I'd expect the links to change the slides and the slide to link to the node.

I set up a link field on the slider content type called 'slider-link'. This is where the user will go when clicking on my slides. You could do somehting like:

Field: slider-link - exclude from display - formatter 'URL, as link'
Field: view result counter - exclude from display - output as link [field_slider_link]

Format - Settings: Pager field - 'Global: View result counter'

For me, that outputted the numbers 1, 2 and 3 as a top pager (I have 3 slides), with each of the numbers linking (on click) to whichever URL I had selected on the slide content type. On hover, nothing happens though, slides don't change. Personally, I wont use this, I was just interested to see if what you suggested could be done.

Maybe something similar would work for you.

Sam.

jjjames’s picture

Cool! Works in D7 as well, thanks!

chowdah’s picture

Hi Samwillc,
in the previous verison of Views Slideshow, this was the behavior and my users got used to it (hovering over the button to change the slide). That's the only reason I would want to duplicate it. Thanks for all you help though!

mattys’s picture

Hi chowdah

In your first, opening post, above, you write "Right now all I am capable of doing is inserting the pager control that uses one of the fields as pager link text - like the node title." - this is exactly what i am trying to achieve. However, i cannot find instructions of how to do so.

my site is here http://www.hartlandpeninsula.co.uk/

I would like to change the pager so is NOT numbers, but node title, as you mention...

if i can achieve this i would then like to replace the main menu, e.g. 'Incredible Landscapes' etc., with pager, so, you when mouseover the pager link it changes the image, caption, etc., but if you click it takes you to the correct page, as is the case with the pagers at the mo'.

Can you possibly briefly explain how you achieved this? i am fairly proficient, so, doesn't need to be to detailed.

Matt

chowdah’s picture

Hi Matt,

Apparently the mouse-over behavior is a little harder to achieve than it was in 6.x.2.x., and I have yet to duplicate that behavior - mouse over button = change slide, click button =go to node. Right now, I got as far as making the pager change the slide when the buttonis pushe, but you have to click the title or the slide image to navigate to the node. I like the old way because the functionality flowed better in my mind, and my users were used to it.

For Title as the pager text, open the slideshow style options in the view and scroll to the bottom of the options dialogue. Under the 'Bottom Widgets' setting, you'll see the pager checkbox and then some options to play with. Select 'fields' as the pager type and then you should have the option to check off the 'Node: Title' as the value. Click 'Update' then 'Save' and all that's left is the styling!

samwillc’s picture

I have used the slider at http://www.hartlandpeninsula.co.uk/ (nice site btw).

I find the 'rollover does one thing and click does another' method really counter intuitive. A number as a link gives the user no clue as to what page they are going to end up on. As an example on a blog view page, it's like 'comments (2)' makes sense but '2' on its own doesn't.

Of course it's actually none of my business how you set it up. just giving another perspective.

Sam.

mattys’s picture

thanks chowdah, will give that a go

yes, samwillc, i agree, this kind of menu could be confusing, but it was just a suggestion made by the client, which we are reassessing, but good to know that i can achieve if we want (assuming all goes to plan referring to chowdah's instructions), and, thanks for compliment

mattys’s picture

FileSize
101.59 KB

chowdah - how annoying, there is nothing of what you say in your post, no bottom widgets, no pager checkbox, no settings to play with, no Select 'fields' as the pager type or anything, weird, i am using Views Slideshow 6.x-3.0 too, as per attachment

chowdah’s picture

FileSize
307.75 KB

mattys very strange... Here's my screen shot!

mattys’s picture

thanks chowdah, that'll help trying to find out what and why...

chowdah’s picture

So I got this to work the way I wanted it to originally function. Mouse over now changes the slide in the slideshow, and clicking the pager number links directly to the node. Follow the direction above in #2, but take some extra steps. My solution assumes you have the modules Token and PathAuto.

  • Include a field in the View for Node: Path, but exclude it from display and check the box in the field configuration that states 'Use Absolute URL'.
  • On the field you use to display the pager information (Global: View result counter) Rewrite the output of the field
    • Check 'Output this field as a link' and for the link value you can use the [path] Token for the Node: Path field - forget about using an anchor as a link.

Now you pager should change the slide when hovering on the pager number and clicking th pager number will open the corresponding node!

redndahead’s picture

Status: Active » Fixed

I think this is fixed now from the original issue.

ryanoreilly’s picture

Status: Fixed » Active

#2 Worked great for me, the numbered pager links cycle through successfully. The issue I'm having is dealing with the "active" state of each counter. Every time I reload the page, the active class "jumps" from the first to second counter number before any transition occurs. Even if I pause the slideshow on start, the active state still jumps from #1 to #2 about 2-3 seconds after reload.

Like I said, everything seems to work just fine, but I can't seem to get this "jump" from occurring on each page load.

EDIT: Not ideal, but downgraded to views 2 and slideshow 2.

janton’s picture

subscribe!

ailgm’s picture

I used images of buttons/dots and adding this hid the numbers:
"font-size: 0pt;"

Thanks for sharing the css.

samwillc’s picture

You can also hide the numbers by wrapping a span like this (I can't remember exactly the content counter html off hand, something like this):

<div class="views-content-counter">
<a href="#"><span class="hideNumber">1</span></a>
<a href="#"><span class="hideNumber">2</span></a>
<a href="#"><span class="hideNumber">3</span></a>
</div>
.views-content-counter a {
display: block;
float: left;
margin-right: 20px;
height: 25px;
width: 25px;
background: url(../images/YOUR-PAGER-IMAGE-WHICH-IS-25px-by-25px.png);
background-position: 0px 0px;
}

.views-content-counter a:hover {
background-position: -25px 0px;
}

.active .views-content-counter a{
background-position: -25px 0px;
}

.hideNumber {
display: none
}

Remember, the span has to be INSIDE the a link tag or this will hide the number and your new styles.

Sam.

jmcintyre’s picture

Yet another way to hide pager numbers if you're using a dot or other graphic... this one requires no extra markup.

<div class="views-content-counter">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
</div>
.views-content-counter a {
display: block;
float: left;
margin-right: 20px;
height: 25px;
width: 25px;
background: url(../images/YOUR-PAGER-IMAGE-WHICH-IS-25px-by-25px.png);
background-position: 0px 0px;
text-indent: -9999px; /* this effectively hides the text */
}
samwillc’s picture

#22, very nice :)

Sam.

code-brighton’s picture

I had the same issue as woofers02 in #18

I'm using Views Slideshow 6.x-3.0 (maybe an issue in 7.x too?)

found the problem in views_slideshow_cycle.js

// We need to set a timeout so that the slideshow doesn't wait
// indefinitely for all images to load.
setTimeout("Drupal.viewsSlideshowCycle.load('" + fullId + "')", settings.wait_for_image_load_timeout);

So the load of the slideshow is happening twice. However this should be captured by

if (!settings.loaded) {

However settings.loaded never seems to be set to true!

So I changed the code to:

if (!settings.loaded) {
settings.loaded = true;

And that fixed the issue in #18 for me

AntiNSA’s picture

I would really like a numbered pager for slideshow... any way we can get this working?

ergophobe’s picture

Much simpler answer over here:

http://drupal.org/node/1648966

- Essentially, just use a full pager and the built in Views Result counter and set that field to use as a pager.

The solution in the link above hides the numbers by setting their color to the same as the background color and creates navigation "dots" but using border-radius.

Just change the color so the text shows and you have your numbered pager.

ergophobe’s picture

Status: Active » Closed (works as designed)
ergophobe’s picture

RE #18

Every time I reload the page, the active class "jumps" from the first to second counter number before any transition occurs.

Do you have a pager offset? Do you have a custom start point? Double-check your slideshow and pager settings.

dmkelner’s picture

Thanks to everyone on this thread. Nice work!