Announcement

Collapse
No announcement yet.

Custom Section List With Sub Sections

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Cheers...I got somewhat sidetracked by Uncle Google yesterday...can see the list is what I need. Thank you again.

    I've ordered that. Hopefully all my problems will soon be over!

    Comment


      #47
      Thanks for the leg-up

      I've edited the code so that it now only opens the Section Tree where the page is active and also I've given all the list items a unique id so that they can be located in the DOM tree and therefore you can make nice flyout menu's using javascript and css if that's your bag.

      Code:
      <div id="categoriesContent" class="sideBoxContent">
      <script type="text/javascript">
          <!--
              a = "";
              d = "";
              listCount = "";        
          //-->
      </script>
      <actinic:block php="true" >
          $downCount=0;
          $listCounter=0;
      </actinic:block>
      <actinic:block type="EntireSectionList">
      <actinic:block php="true" >
          $sectionLevel = "<actinic:variable name="SectionLevel" />";
          $listCounter=$listCounter+1;
          if($sectionLevel==1)
          {$downCount=$downCount+1;
          }
      </actinic:block>
      <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNamePrev%22%20%2f%3e%20%3d%3d%20%22%22%29%20AND%20%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3c%3d%203%29" ><ul></actinic:block>
      <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%20%3c%3d%203%29" >
          <li<actinic:block if="%3cactinic%3avariable%20name%3d%22SectionID%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionID%22%20%2f%3e" > class="currentPage"</actinic:block> id="D<actinic:block php="true" >echo $downCount;</actinic:block>A<actinic:variable name="SectionLevel" />L<actinic:block php="true" >echo $listCounter;</actinic:block>" <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3e%201" >style="display:none;"</actinic:block>><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a></li>
      </actinic:block>
      <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionID%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionID%22%20%2f%3e%20%20AND%20%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3e%3d%20%201" >
          <script type="text/javascript">
          <!--
              d = "<actinic:block php="true" >echo $downCount;</actinic:block>";
              a = "<actinic:variable name="SectionLevel" />";    
              listCount = "<actinic:variable name="ListCount" />";
          //-->
          </script>
      </actinic:block>
      <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNameNext%22%20%2f%3e%20%3d%3d%20%22%22%29%20AND%20%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3e%3d%202%29%20AND%20%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%20%3c%3d%203%29" ></ul></actinic:block>
      <actinic:block php="true" >
              $prevSectionLevel = "<actinic:variable name="SectionLevel" selectable="false" />";
      </actinic:block>
      </actinic:block>
      </ul>
      
      <script type="text/javascript">
          <!--
            a = a*1;
            listCount = listCount*1;
            for(i=1;i<=4;i++)
            {        
              if(d&&a)
              {     
                  //now loop through and turn on all elements in this list and the one below
                  for(ii=1;ii<=listCount;ii++)
                  {
                      elementID = "D"+d+"A"+i+"L"+ii;
                      activePanel = document.getElementById(elementID);
                      if(activePanel)
                      {activePanel.style.display="block";
                      }
                  }
              }
            }
          //-->
      </script>
      </div>
      Last edited by Orchid; 28-Sep-2008, 10:12 AM. Reason: code bug
      Wayne Theisinger

      The Web's just settling in. We got the tech, now let's put up something that matters.

      Comment

      Working...
      X