hi,

great modul, thanks for your efforts:

is it possible to change the behaviour of the pager so that it changes the slide on mouseover and on click (on the pager) it goes to the node?

i rewrote the pager-thumbnail output like this in views:

<a href="node/[nid]" class="page-link">[field_news_thumb_fid_1]</a>

this looks ok on the views-preview, but ddblock-example themes also add a link to the pager and displays a blank pager next to my custom pager. on the blank pager the mousover/change slide works, on my custom pager only the click to enter node works.

heres the source code of my display:

<div class="custom-pager-item-inner"> 
      <a href="#" title="navigate to topic" class="pager-link"></a><a href="http://localhost/test/de/work/43/friends-of-the-earth-1-infofilm-textilien" class="page-link"><img src="http://localhost/test/sites/default/files/imagecache/Thumb_61/Thumb-gross_61x48_0.jpg" alt="" title="" class="imagecache imagecache-Thumb_61 imagecache-default imagecache-Thumb_61_default" width="61" height="48"></a>
</div>

if i remove the line fromt the template file

<a href="#" title="navigate to topic" class="pager-link"></a>

the pager doesnt change on mouseover anymore.

i think i am really close to fix this issue, can you please help me and point me to the right direction?

thanks in advance, cheers,

volker

Comments

vir_2’s picture

update:

i had a typo in my views-rewrite, i wrote class="page-link", but this needs to be "pager-link":

now the mouseover/change slide works on my custom pager, but when i click my custom pager, nothing happens. here is the source of the display:

<div class="custom-pager-item-inner"> 
      <a href="#" title="navigate to topic" class="pager-link"></a><a href="http://localhost/test/de/work/43/friends-of-the-earth-1-infofilm-textilien" class="pager-link"><img src="http://localhost/test/sites/default/files/imagecache/Thumb_61/Thumb-gross_61x48_0.jpg" alt="" title="" class="imagecache imagecache-Thumb_61 imagecache-default imagecache-Thumb_61_default" width="61" height="48"></a>
     </div>

hope this helps, cheers

volker

ppblaauw’s picture

In the Javascript of the module the click functionality is disabled for the class a.pager-link when the pager event is mouseover with the following code:

      // disable click if pager is mouseover
      if (ViewsSlideshowDdblockSettings.pagerEvent == 'mouseover') {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function() {
            return false;
          });
      }

If your second link does not have the class: pager-link, it should work.

Sorry for late reply.

Hope this helps you further, please let me know.

vir_2’s picture

hello and thanks for your reply,

is it also possible to only use 1 <a href="... in the pager item and
change slide on mouseover + go to href on click?

ie my template looks like this:

<div class="custom-pager-item-inner"> 
<a href="http://localhost/test/de/work/43/friends-of-the-earth-1-infofilm-textilien" class="pager-link"><img src="http://localhost/test/sites/default/files/imagecache/Thumb_61/Thumb-gross_61x48_0.jpg" alt="" title="" class="imagecache imagecache-Thumb_61 imagecache-default imagecache-Thumb_61_default" width="61" height="48"></a>
</div>

note: i removed the <a href="#" title="navigate to topic" class="pager-link">...</a> line from the template and i also commented out the

if (ViewsSlideshowDdblockSettings.pagerEvent == 'mouseover') {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function() {
            return false;
          });
      }

in views_slideshow_ddblock.js

i can see the link, i can also open in new tab with right mouse button, but nothing happens on click.
there must be some other place, where the click function is altered by javascript in the slideshow, i guess.

i am not familiar with jQuery, so if this is sort of a big deal to change the code, i would also be glad to pay for your efforts, just PM me.

thanks for your help in advance.

cheers,

volker

vir_2’s picture

found a solution to my feature-request, but this requires to rewrite code in modul javascript code, which is not a wise thing to do:

step 1:

in views_slideshow_ddblock.js replace

      // disable click if pager is mouseover
      if (ViewsSlideshowDdblockSettings.pagerEvent == 'mouseover') {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function() {
            return true; // false
          });
      }

with

      if (ViewsSlideshowDdblockSettings.pagerEvent == 'mouseover') {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function(event){
          location.href = this.href+$(this).serialize();
          event.preventDefault();
          });
      }

step 2:
rewrite the pager output in views with the url to the desired node, in my case:

<a href="node/[nid]" title="more..." class="pager-link" >[field_news_thumb_fid]</a>

step 3:
in the slideshow configuration choose "Pager event: Mouseover"

step 4:
in your views-slideshow-ddblock-custom-pager.xy.tpl.php replace

      <a href="#" title="navigate to topic" class="pager-link"><?php print $pager_item['pager_image']; ?><?php print $pager_item['pager_text']; ?></a>

with:

<?php print $pager_item['pager_image']; ?><?php print $pager_item['pager_text']; ?>
danyg’s picture

hello,

I've experienced the same issue, and want to say thank you to Volker to his snippet.
But I've found an more secure way to fix this problem. It's not good to write directly to module's js file, so fixing in your theme is better solution.

In your theme define a js file in .info, then put Volker's code in it, using the concrete block ID.

$(document).ready(function() {

    $("#views-slideshow-ddblock-news_block_5 a.pager-link").click(function(event){
      location.href = this.href+$(this).serialize();
      event.preventDefault();
    });

});
chaz1975’s picture

Hi, I've had a look at this as I'm after the same thing, but I'm having a little trouble implementing it.

I added a line in my .info file saying that I had a new js file attached:

scripts[ddscript] = ddscript.js

and then added your script above into a file of the same name and cleared the cache.

I have a horrible feeling I'm completely missing something here and would be grateful for any pointers.

Best wishes,

chaz1975

danyg’s picture

Hi Chaz,

you don't need to name the key of the scripts array. Use as

scripts[] = ddscript.js

Than flush the caches.

spgd01’s picture

I can confirm this works. thank you so much. It solved my problem here:
http://drupal.org/node/811154

I still think this feature should be added so that we don't have to edit the code.
Thanks

ppblaauw’s picture

Status: Active » Fixed

comitted to dev version

     // disable click if pager is mouseover
      if (ViewsSlideshowDdblockSettings.pagerEvent == 'mouseover') {
        if (ViewsSlideshowDdblockSettings.pagerDisableClick == 1) {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function() {
            return false;
          });
        }
        else {
          $("#views-slideshow-ddblock-" + pager + "-" + ViewsSlideshowDdblockSettings.block + " a.pager-link").click(function() {
            location.href = this.href;
          });
        }
      }
 

A setting "pager disable click" is added to the configuration page
If this is not checked the href in the pager tpl.php template file will be used to link to another page

In the tpl.php file the following can be used now:

<a href="<?php print $pager_item['pager_url'] ?>" title="navigate to topic" class="pager-link"><?php print $pager_item['pager_image']; ?><?php print $pager_item['pager_text']; ?></a>

Where $pager_item['pager_url'] is the theme_variable "pager_url" mapped in the mapping part of the configuration page.

Status: Fixed » Closed (fixed)

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

vibrasphere’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Closed (fixed) » Active

Don't work. I added the print $pager_item['pager_url'] part to the link, but what's the point if the pager_text is some non-link text field? So now all pager links link to nowhere aka front page. Also there is no pager_url in the block settings for mapping, which would make sense, because you could set to it some link/url field maybe or something.

Because now no matter in what way I try to make it link to the custom page or whatever, via views and etc. it starts printing two links and it breaks the pager.

Also deselecting that "pager disable click" option doesn't apply any effect.

vibrasphere’s picture

Status: Active » Needs work

Okay I solved it, but this is ridiculous.

1. Create a field. A custom link field for your content type and give it whatever path you want to be linked.
2. Go to block settings and in mapping set your pager_text as some custom text field from your content type. You will use it as your custom titles for your pager buttons.
3. So in the views add this custom text field and select output this field as link and put in the custom link field token.
4. Then you go to your theme dir and in theme/custom/modules/ddblock/ edit your slider .tpl.php (e.g. mine is ddblock-cycle-pager-content--upright30p.tpl.php) and entirely remove the line 40, the one with <a></a>.
5. Flush caches and you got it. You got pager with custom titles and custom links, switching slides when mouseover and going to the linked page when clicked.

But again, this is ridiculous.