Accordion Menu Block

Permalink
Hi all,

Just wondering if anyone has developed a working Accordion block for C5 yet? I am a hack when it comes to PHP but was hoping one of you clever guys or gals out there have achieved this?

I tried this:http://www.concrete5.org/community/forums/block_requests/accordion_...

however it throws errors and the thread appears to not be getting any replies from the original poster.

Any pointers would be great.

Richard

 
kino replied on at Permalink Reply
kino
http://c5.tktools.jp/index.php/concrete5/tabs/


/blocks/page_list/templates/accordion.php
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$textHelper = Loader::helper("text");
if (count($cArray) > 0) {
   ?>
   <div class="ccm-page-list" id="accordion">
      <?php
      for ($i = 0; $i < count($cArray); $i++ ) {
         $cobj = $cArray[$i];
         ?>
         <h3><a href="#"><?php echo $cobj->getCollectionName(); ?></a></h3>
         <div class="ccm-page-list-description">
            <?php
               $a =new Area("Main");
               $a->display($cobj);
bryanlewis replied on at Permalink Reply
bryanlewis
Does this work with the auto nav?
kino replied on at Permalink Reply
kino
complae.
but,not perfect.

<?php
   defined('C5_EXECUTE') or die(_("Access Denied."));
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   echo("<div id=\"accordion\">");
   $nh = Loader::helper('navigation');
   foreach($aBlocks as $ni) {
      $_c = $ni->getCollectionObject();
      if (!$_c->getCollectionAttributeValue('exclude_nav')) {
         echo('<h3><a href="#">' .  $_c->getCollectionName(). '</a></h3>');
         ?>
         <div class="ccm-page-list-description">
            <?php
            if ($c->getCollectionID() == $_c->getCollectionID()) {
            } else {
bryanlewis replied on at Permalink Reply
bryanlewis
This doesn't function they way I thought it would. with a fresh install it basically just shows everypage in the one block for me... kind of weird.
matogertel replied on at Permalink Reply
matogertel
There are a couple of blocks that would do that.
There's my own Area Splitter which includes an accordion template from jQuery UI :-)
And there's one created by jgarcia I think in the marketplace and a free one created by remo.
bryanlewis replied on at Permalink Reply
bryanlewis
Right I know the functionality is there in many places but do they work with the autonav block? and if so how?