Hello i was wondering how one would go about adding the accordian style to blocks in a sidebar.

I presume i have to make a tpl file up just for a sidebar and then add the accordian classes to .....errrr i dunno.

Could anyone point me in the right directon?

Thanks

Comments

fadgadget’s picture

So ive created a tpl for my block view and i now 'control it'. Ive added the code like so. It seems to be working ok but its showing 'open' as default. Maybe its becuase ive just overidden one block.

<?php
<div class="<?php print $classes;
?>

">

<?php
 
print render($title_prefix);
?>
<?php
 
if ($title):
?>
<?php
 
print $title;
?>
<?php
 
endif;
?>

<?php
 
print render($title_suffix);
?>
<?php
 
if ($header):
?>
<?php
 
print $header;
?>
<?php
 
endif;
?>
<?php
 
if ($exposed):
?>
<?php
 
print $exposed;
?>
<?php
 
endif;
?>
<?php
 
if ($attachment_before):
?>
<?php
 
print $attachment_before;
?>
<?php
 
endif;
?>
<?php
 
if ($rows):
?>
<?php
 
print $rows;
?>
<?php
 
elseif ($empty):
?>
<?php
 
print $empty;
?>
<?php
 
endif;
?>
<?php
 
if ($pager):
?>
<?php
 
print $pager;
?>
<?php
 
endif;
?>

?>

fadgadget’s picture

mmm that never worked. Here is my block tpl with the accordian stuff added abut it. I did half random where i placed the code so theres a lot of room for me to be wrong.
http://pastebin.com/WWK71C69

tonystar’s picture

Do you still need any help with accordion? If so - could you please clarify - do you want to place all blocks in the sidebar to the accordion? Or something else?