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.
You currently can't override views-slideshow-pager-field.tpl.php due to the fact that the key provided in hook_theme() doesn't match the name of the template file (see http://drupal.org/node/342350).
I've attached a patch which resolves this.
Comment | File | Size | Author |
---|---|---|---|
#5 | pager_fields_template_3.patch | 5.91 KB | inolen |
pager_fields_template.patch | 2.66 KB | inolen | |
Comments
Comment #1
inolen CreditAttribution: inolen commentedAlso, to add to this, I was over-riding this template to add some jCarousel wrapper elements but that then broke functionality in Drupal.behaviors.viewsSlideshowPagerFields.
When it adds handlers on the pager items in the Drupal.behaviors.viewsSlideshowPagerFields.attach function, it calls:
This breaks when the immediate children aren't the pager items, so to fix it I did:
I'm not sure if this is the best fix, but it got me up and running.
Comment #2
inolen CreditAttribution: inolen commentedFinal note is that after making the template overrideable, I then only wanted to override it for specific views, so I added:
inside of template_preprocess_views_slideshow_pager_fields(). I also added the same for the field item templates. If anyone would like I could re-roll the original patch, js changes and these hook suggestions into one patch.
Comment #3
milesw CreditAttribution: milesw commentedJust encountered this and the posted patch worked...after I noticed that the name of the template file changed too. There seems to be remaining issues with other templates though.
Comment #4
inolen CreditAttribution: inolen commentedThere are definitely other things that don't theme properly, and yes, the template name changed a bit.
I'll re-roll my patch with everything I ended up doing later tonight.
Comment #5
inolen CreditAttribution: inolen commentedRe-rolled the patch, what it fixes:
- Makes it possible to override what is now views-slideshow-pager-fields.tpl.php (was views-slideshow-pager-field.tpl.php) and views-slideshow-pager-field-item.tpl.php
- Adds suggestions for each of the above .tpl.php based on your view name
- Fixes JS error when the field items aren't the direct children of the main element in views-slideshow-pager-fields.tpl.php. For example, my custom views-slideshow-pager-field.tpl.php looks like so:
Patched against the latest on 7.x-3.x-dev.
Comment #6
milesw CreditAttribution: milesw commentedThanks, the patch from #5 solves the original issue for me. Hopefully this gets committed soon because this issue makes theming quite difficult. I created a separate issue for the other (less significant) template that's been broken for me: #1191586: Cannot override views-slideshow-controls-text.tpl.php.
Comment #7
redndahead CreditAttribution: redndahead commentedA patch similar to this was committed. None of the javascript was committed and should be added to a new issue with a thorough description of the problem.