Sharak Posted August 2, 2013 Share Posted August 2, 2013 http://5.9.94.3/~fraben/ It's about default presta module "Homeslider". I changed style of bx-pager to fill right column with buttons. By default text in buttons is just slide number (1, 2 , 3, ...). I need slide title and description instead. The code I need to change is in jquery.bxSlider.min.js in line 92: {pagerString+='<a href="" class="pager-link pager-'+i+'">'+i+'</a>';} I'm not so good with javascipt and really don't know how to change this second "i" with: {$slide.title|escape:'htmlall':'UTF-8'} <br> {$slide.description|escape:'htmlall':'UTF-8'} (code from homeslider.tpl) Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2013 Share Posted August 2, 2013 in the tpl file you can define javascript vars in foreach loop (exactly the same as for images in the slider) var mydesc1 = 'description of slide1'; var mytitle1 = 'title'; then in the slider js file you can use these variables instead the simple i (you can dynamically add variables there based on "mydesc"+i and "mytitle"+i Link to comment Share on other sites More sharing options...
Sharak Posted August 2, 2013 Author Share Posted August 2, 2013 (edited) Where and how exactly am I supposed to implement this? I'm just messing it up I added this in tpl's {foreach} section: {assign var=mytitle value={$slide.title|escape:'htmlall':'UTF-8'[spam-filter] {assign var=mydesc value={$slide.description|escape:'htmlall':'UTF-8'[spam-filter] But it's changing the same variable so it's always the last value at the end. How to combain this with .js's $i variable and then implement this combained variables in js's for loop? Edited August 21, 2013 by Sharak (see edit history) Link to comment Share on other sites More sharing options...
Sharak Posted August 5, 2013 Author Share Posted August 5, 2013 Still no clue how to make it work. I understand the idea of the solution above but don't know how to combine tpl and js vars Link to comment Share on other sites More sharing options...
Sharak Posted August 21, 2013 Author Share Posted August 21, 2013 Up Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now