Open an accordian item in a new page specific to value in URL
The following checks if there is a customer testimonial assigned to a product and, if so, creates a link from the product page to the testimonial (with a unique id 'testimLink')
The testimonials are all on a separate page in an accordian menu (click on an item and it expands) so what I need to be able to do is expand the testimonial with the 'testimLink' passed in the URL.
I thought I could do this using jQuery but I'm not sure how to pass the function to a new page?
There's surely a way to do this with jQuery, but you could also add a "selected" class to the appropriate list item via XSLT. I don't know what your code looks like, but something like this should work in the template/macro that renders your testimonials page:
Open an accordian item in a new page specific to value in URL
The following checks if there is a customer testimonial assigned to a product and, if so, creates a link from the product page to the testimonial (with a unique id 'testimLink')
The testimonials are all on a separate page in an accordian menu (click on an item and it expands) so what I need to be able to do is expand the testimonial with the 'testimLink' passed in the URL.
I thought I could do this using jQuery but I'm not sure how to pass the function to a new page?
Can anyone help me out?
Thanks.
There's surely a way to do this with jQuery, but you could also add a "selected" class to the appropriate list item via XSLT. I don't know what your code looks like, but something like this should work in the template/macro that renders your testimonials page:
Hi Dan, thanks for your response - I can definitely see how this would work but the <li> already have a class defined..
My code on the testimonials page is
So I'm thinking maybe I need to use jQuery .addClass to make this work but I'm not too hot on jQuery!!
Hey Rachel,
Dan's solution is correct, to add more than one class you just add all the classes you need back into the attribute
Rich
Ah, thank you :)
is working on a reply...