Closed (won't fix)
Project:
Dynamic display block
Version:
6.x-1.0-rc6
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2009 at 20:07 UTC
Updated:
24 Sep 2009 at 04:20 UTC
Hi,
I am thinking about making the pager item text a link to the node in addition to the read more link. I've played around a little with the template file to see that if I replace the hardcoded
<a href="#" title="navigate to topic" class="pager-link"><?php print $pager_item['text']; ?> </a>
to something like:
<a href="http://somesite.com" title="navigate to topic" class="pager-link"><?php print $pager_item['text']; ?> </a>
I get a working link and the surrounding space of the pager still picks up the javascript trigger to advance the pager.
I've tried to adapt the code to pick up the node ID but I am not getting it to work.
If you could help me out with some suggestions for how to link to the node from the ddblock template file I'd appreciate it.
Thanks,
David
Comments
Comment #1
ppblaauw commentedThe link is supposed to be used for selecting a slide.
(maybe it is confusing for your users what the link is for and what the pager item itself is for.)
In future versions of the ddblock module, the link will be used for making the slideshow work without javascript enabled (graceful degradation) (so I will not add this as a feature of the ddblock module)
But...
You could add a node_url variable to the pager preprocess function:
And use this variable in the pager template file:
Hope this helps you further, please let me know.
Comment #2
biscuit.tech commentedThanks, and for what it's worth I agree that it's a bad idea but I am being asked to do this despite many attempts to argue against it.
I've tried your suggestion and it almost works - hovering over the pager shows the right node id as the link - but the click is picked up by the javascript to send the viewer to the next pager instead of the node.
Would it be possible to instead insert a link icon after the Pager Text than is for node and doesn't get interrupted by the javascript for advancing the pager?
Thanks!
David
edit: Never mind, I figured out that renaming the class to something other than pager-link takes care of the javascript.
- David
Comment #3
ppblaauw commentedYes, like you say:
The class a.pager-link is used in the javascript to select the slide.
This is done this way, so you could have also other links in the pager for, e.g. to go to another page or to the node itself.