Is it possible to put in the body of the accordion (maybe in the header or the footer of the view) an additional link / button with the correct css class code to close the current accordion (it could be useful if you re-themize the accordion and make it wider, as wide as the main container of your theme)?
Do you think it will work?

Comments

manuel garcia’s picture

You could use the open all / close all button perhaps, but I dont think this is what you want.

You could definetly do it with some custom jquery triggered when you click on the link you want though, that should work. Of course you'd need to:

1. Print the link somehow (in the tpl or so).
2. Know enough js/jquery to trigger the right event on click.

ilgriso’s picture

Yes, thanx, it's what I did.

If someone is interested in, I modified the file views-view-accordion.tpl.php at row #27 :

<div id="close-acc" style="float:right;"><a href="#" class="button2">Close</a></div>

and views-accordion.js from row #27 an addtional link to close the accordion:

var $contenitore = $viewcontent.children();
$('a.button2', $contenitore).click(function () {
$content.slideUp(speed);
$triggers.removeClass(activeClass);
return false;
    });
manuel garcia’s picture

You should really move that to your own js file, if you want to avoid problems when upgrading the module, standard practice. Only difference would be that you'd need to select the appropriate element to slideup etc yourself.

manuel garcia’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

Closing now due to 6.x no longer supported.