I added the Accordion module on Drupal 7 and it works without any problem, but I would like to change the style of the view. I have already read the documentation, but I don't know how I can put CSS styles to the view.

I can add styles to the views-accordion.css file but I don't know how to add the classes to the view or how to make it use my styles instead of its default styles.

Update :

I edited the file views-view-accordion.tpl.php, but still no result ! The styles will not change !


You have to check this:

This module comes with a default css stylesheet, which you can disable in the options.

Files included for your convinence:

  • views-acordion.css - A default stylesheet with how the classes the author thought would be best used.

  • views-view-accordion.tpl.php - copy/paste into your theme directory - please the comments in this file for requirements/instructions. Both files are commented to explain how things work. Do read them to speed things up.

So you have to follow this instructions, add a custom styles on your theme, add custom classes in your template (If you need it), but dont forget default clasess make animation work.

  • Thank you for copying and pasting what is in the module page :S I already saw it in read me file too ! Well it's not working ! My question is if there is any solution to make it work !
    – Sinf
    Mar 23 '17 at 11:28
  • You are wellcome, I sugest you to do constructive comments, for me it works, so give more details to help you: module version, some debugging things you have done, etc. Mar 23 '17 at 16:36
  • Actually I think I found the solution :) but I have to check it tomorrow.
    – Sinf
    Mar 23 '17 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.