Announcement

Collapse
No announcement yet.

Sub Section home index page

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

    Sub Section home index page

    Hi,

    Could anyone help me with this layout please...

    I am trying to have on my home page only a section layout as below in my middle section of the page (not left column):

    Main Section Name
    Subsection 1 Subsection2 Subsection 3
    Subsection 4 Subsection5 Subsection 6

    Next Main Section Name
    Subsection 1 Subsection 2 Subsection 3
    Subsection4

    Next Main Section Name
    Subsection1 Subsection2

    etc with subsections laying out in 3 columns BUT also I want to apply a condition so that some sections do not display, I read some other posts about creating a section vairable for example a number and then using a condition to say only include on home page all section variable greater than value of 2 but I cant seem to get it working.

    Plus what do I do if I do not have sections that equal 3, ie 5 sections, how do I make the next Main Section align to the left and not at the end of the last subsection column?

    On all of my other pages I want the exact same menu but instead of the subsections laying out in 3 to a column in the middle I want the subsections below each other and all in the left column...

    i.e.

    Main section
    subsection1
    subsection2
    subsection3

    Next Main section
    subsection1
    subsection2
    subsection3 etc

    phew....

    I spent all day trying to do this yesterday and am now admitting defeat...If I am asking for too much help then suggestions would be great.

    thank you anyone who can offer any suggestions.... thx and I have looked on forum for hours and cant find anything, hence now asking for help..

    Samantha
    Last edited by sammymac; 30-Dec-2006, 06:29 AM. Reason: additional info
    http://www.novadetox.co.uk

    #2
    Hi,

    I have some code that will put your top level sections in a different font to the subsections but I'm afraid that it only lays the subsections out in a single column. I've been trying to find a way of getting them into three columns but have also had problems. I'm going to ask our development team if there is a way of doing this. However, in the meantime, here is the code I mention above:

    Code:
    <actinic:block type="EntireSectionList" >
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%201" >
    <a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" class="product_section">
       <actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%21%3d%201"><br /><br /></actinic:block>
     <span style="font-size: 2em;"><Actinic:Variable Name="SectionName"/></span>
     <br />
    </a>
    </actinic:block>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202">
    <a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" class="product_section">
       <Actinic:Variable Name="SectionName"/>
    </a>
    </actinic:block>
    </actinic:block>
    This needs to go on your brochure page overall layout.
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      Hi Samantha,

      I've managed to come up with some javascript that will display your sub-sections in columns of 3. In order to have the sections showing in the left column too, you will need two different javascript functions.

      This first one is for your home page main list (in the middle of the page):

      Firstly, create a new layout that will just be applied to your home page (Design | Library | Layouts tab | Web Page Outer Layout | copy your current brochure page layout and rename it to something relevant).

      Put the following code between just before the </head> tag

      Code:
      <actinic:variable value="All Data From All Sections" name="JavaScriptArray" />
      
      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function SectionList1(ar)
      {
      var strIDs = '<table border=0 width=95% cols=2>';
      var counter=0;
      for (var i=1;i<=ar.length;i++)
      {
      if (ar[i].sURL !=null)
      {
      strIDs += '<tr><td colspan=2><a href="' + ar[i].sURL + '"><span class="regular"><b>' + ar[i].sName + '</b></span></a></td></tr>';
      {
      if (ar[i].pChild)
      {
      for (var j=1;j<=ar[i].pChild.length;j++)
      {
      if (j <= ar[i].pChild.length)
      {
      counter=counter+1;
      if(counter==1){
      	strIDs += '<tr>'
      	}
      	strIDs += '<td><img src=shim.gif width=5></td><td><a href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].sName + '</span></a></td>';
      if(counter==3){
      	strIDs += '</tr><tr>';
      	counter=0
      	}
      }
      }
      }
      }
      }
      }
      strIDs += '</table>' 
      return strIDs
      }
      //-->
      </SCRIPT>
      
      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function SectionList(ar)
      {
      var strIDs = '<table border=0 width=95% cols=2>';
      for (var z=1;z<=ar.length;z++)
      {
      if (ar[z].sURL !=null)
      {
      strIDs += '<tr><td colspan=2><a href="' + ar[z].sURL + '"><span class="actxxsmall">' + ar[z].sName + '</span></a></td></tr>';
      {
      if (ar[z].pChild)
      {
      for (var y=1;y<=ar[z].pChild.length;y++)
      {
      if (y <= ar[z].pChild.length)
      {
      strIDs += '<tr><td><img src=shim.gif width=5></td><td><a href="' + ar[z].pChild[y].sURL + '"><span class="actxxsmall">' + ar[z].pChild[y].sName + '</span></a></td></tr>';
      }
      }
      }
      }
      }
      }
      strIDs += '</table>' 
      return strIDs
      }
      //-->
      </SCRIPT>
      In the same layout, put the following into the body of the layout for the left-hand menu list:

      Code:
      <script language=Javascript1.1>document.write(SectionList(section_tree))
      </script>
      For the list in the middle of the page, put the following code into the 'Standard Brochure Page Bulk' layout (at the top of the layout):

      Code:
      <script language=Javascript1.1>document.write(SectionList1(section_tree))
      </script>
      Apply this layout to your home page only.

      Then add the following into your standard brochure page layout for the other brochure pages and your site overall layout to have the section list in 1 column in the left side bar. Put it before the </head> tag:

      Code:
      <actinic:variable value="All Data From All Sections" name="JavaScriptArray" />
      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function SectionList(ar)
      {
      var strIDs = '<table border=0 width=95% cols=2>';
      for (var z=1;z<=ar.length;z++)
      {
      if (ar[z].sURL !=null)
      {
      strIDs += '<tr><td colspan=2><a href="' + ar[z].sURL + '"><span class="actxxsmall">' + ar[z].sName + '</span></a></td></tr>';
      {
      if (ar[z].pChild)
      {
      for (var y=1;y<=ar[z].pChild.length;y++)
      {
      if (y <= ar[z].pChild.length)
      {
      strIDs += '<tr><td><img src=shim.gif width=5></td><td><a href="' + ar[z].pChild[y].sURL + '"><span class="actxxsmall">' + ar[z].pChild[y].sName + '</span></a></td></tr>';
      }
      }
      }
      }
      }
      }
      strIDs += '</table>' 
      return strIDs
      }
      //-->
      </SCRIPT>
      and the following in the main body of the layout where you want the list to appear:

      Code:
      <script language=Javascript1.1>document.write(SectionList(section_tree))
      </script>
      I hope this helps.
      ********************
      Tracey
      SellerDeck

      Comment

      Working...
      X