Hello,

I am trying to get the jquery_ui accordion to work in my page theme template file. Here is the snippet of code in my page.tpl.php file that I am using for the accordion (well actually I have this in a separate file that I add to the page.tpl.php file via a php include - I mention this in case it makes a difference)

<?php
drupal_add_library('system', 'ui.accordion');
drupal_add_js('jQuery(document).ready(function(){jQuery("#accordion").accordion({autoHeight: false});});', 'inline');
?>

  <DIV id="accordion">
  <H3 class="next-game"><A href="#"></A></H3>
  <DIV class="accordion-next-game-content">
    <?php
      //opponent arena info
      $viewName = 'next_game';
      $display_id = 'default';
      $argument = '';
      print views_embed_view($viewName, $display_id, $argument);
      ?>
 </DIV>
  <H3 class="last-game"><A href="#"></A></H3>
  <DIV class="accordion-last-game-content">
     <?php
       $viewName = 'game_score';
       $display_id = 'default';
       $argument = '';
       print views_embed_view($viewName, $display_id, $argument);
     ?>
  </div>
    <H3><A href="#">Section 3</A></H3>
  <DIV class="accordion-ticket-prices-content">
    <P>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </P>
    <UL>
    <LI>List item one</LI>
    <LI>List item two</LI>
    <LI>List item three</LI></UL>
  </DIV>
</DIV>

Comments

saepl’s picture

I got it to work. I just had to turn on "Aggregate Javascript" in the configuration page