Announcement

Collapse
No announcement yet.

Section List

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

    Section List

    Hi,

    I am in the process of setting up a store. Currently I have have 9 Sections, all of which have from 4 to 7 Sub-Sections. All the Sub-Sections are currently empty, but intend to add more Sub-Sections and Products.

    I am trying to create a HTML Unordered List to show only the top 2 section levels. I have looked at the information on this page and made some changes to fit my needs. This is what I have generated.

    Code:
    <ul id="navMenu">
    <actinic:block type="EntireSectionList" >
        <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%201"><li class="topItem"><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a></actinic:block>
        <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202" >
            <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNamePrev%22%20%2f%3e%20%3d%3d%20%22%22%29" ><ul class="subMenu"><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>" class="top"><actinic:variable name='SectionName'/></a></li></actinic:block>
            <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNamePrev%22%20%2f%3e%20%21%3d%20%22%22%29%20%26%26%20%28%3cactinic%3avariable%20name%3d%22SectionNameNext%22%20%2f%3e%20%21%3d%20%22%22%29" ><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a></li></actinic:block>
            <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNameNext%22%20%2f%3e%20%3d%3d%20%22%22%29" ><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>" class="foot"><actinic:variable name='SectionName'/></a></li></ul></li></actinic:block>
        </actinic:block>
    </actinic:block>
    </ul>
    With the intention to generate;

    Code:
    <ul id="navMenu">
        <li class="topItem"><a href="#">Section 1</a>
            <ul class="subMenu">
                <li class="subItem"><a href="#" class="top">Sub Section 1 a</a></li>
                <li class="subItem"><a href="#">Sub Section 1 b</a></li>
                <li class="subItem"><a href="#">Sub Section 1 c</a></li>
                <li class="subItem"><a href="#" class="foot">Sub Section 1 d</a></li>
            </ul>
        </li>
        <li class="topItem"><a href="#">Section 2</a>
            <ul class="subMenu">
                <li class="subItem"><a href="#" class="top">Sub Section 2 a</a></li>
                <li class="subItem"><a href="#">Sub Section 2 b</a></li>
                <li class="subItem"><a href="#">Sub Section 2 c</a></li>
                <li class="subItem"><a href="#" class="foot">Sub Section 2 d</a></li>
            </ul>
        </li>
    </ul>
    This was working perfectly when I had fewer Sections and Sub-Sections. But as I increased the complexity, moved items around and deleted items Actinic now just does not want to play ball.

    The following line always returns true.
    Code:
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNamePrev%22%20%2f%3e%20%3d%3d%20%22%22%29" ><ul class="subMenu"><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>" class="top"><actinic:variable name='SectionName'/></a></li></actinic:block>
    While these 2 statements always return false.
    Code:
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNamePrev%22%20%2f%3e%20%21%3d%20%22%22%29%20%26%26%20%28%3cactinic%3avariable%20name%3d%22SectionNameNext%22%20%2f%3e%20%21%3d%20%22%22%29" ><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a></li></actinic:block>
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionNameNext%22%20%2f%3e%20%3d%3d%20%22%22%29" ><li class="subItem"><a href="<actinic:variable name="SectionPageName"/>" class="foot"><actinic:variable name='SectionName'/></a></li></ul></li></actinic:block>
    Please help me on this one, I am pulling my hair out over it! Thanks for your time.

    Stewart

    #2
    Quick note; I am using Actinic Business version 9.

    Comment


      #3
      At a quick glance i think you are going to need to use listindex and listcount to identify the location in the list, not the next and previous fields, but i might be wrong as i have never done a menu using the method you have. To fault find it, strip out the first and last parts of the code and get the list, if that works, then you know what i am saying above is probably right.

      Comment


        #4
        I was unaware of ListIndex and ListCount but after just having a quick play around I have discovered;

        ListCount always returns 53 which the number of Sections plus the number of Sub-Sections I have currently got.

        ListIndex returns an incrementing number from 1 - 53.

        I am not sure how this will help me without hardcoding numbers in which is an option best to be avoided.

        Comment


          #5
          Right, I have gone right back to the basics to produce a list and see the output etc. This is the code;
          Code:
          <ul id="navMenu">
          <actinic:block type="EntireSectionList" >
              <li><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name="SectionNamePrev" /> - <actinic:variable name="SectionName" /> - <actinic:variable name="SectionNameNext" /></a></li>								
          </actinic:block>
          </ul>
          This is the output;
          Code:
          <ul id="navMenu">
          <li><a href="#">  - Section 1 - Section 2</a></li>
          <li><a href="#">  - SubSection 1 a - SubSection 1 b</a></li>
          <li><a href="#">  - SubSection 1 b - SubSection 1 c</a></li>
          <li><a href="#">  - SubSection 1 c - SubSection 1 d</a></li>
          <li><a href="#">  - SubSection 1 d - SubSection 1 c</a></li>	
          <li><a href="#">  - Section 2 - Section 3</a></li>
          <li><a href="#">  - SubSection 2 a - SubSection 2 b</a></li>
          <li><a href="#">  - SubSection 2 b - SubSection 2 c</a></li>
          <li><a href="#">  - SubSection 2 c - SubSection 2 d</a></li>
          <li><a href="#">  - SubSection 2 d - SubSection 2 c</a></li>
          </ul>
          So I can determine from this;
          SectionNamePrev never returns a value.
          SectionNameNext always returns a value.
          When SectionNameNext should equal "", it infact returns what SectionNamePrev should be set to.

          My question is why? Am I missing something? Alternative solutions?

          Comment


            #6
            I have just gone back to the original code. I have also added a number of Sub-Sections to the existing Sub-Sections and everything works perfectly.

            I am not going to question the mechanics of it, just accept it.

            Comment

            Working...
            X