Announcement

Collapse
No announcement yet.

Check level of next section in list

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

    Check level of next section in list

    Using a standard section list it happily runs through the top level sections and the child sections of each eg:

    TLS 1
    - sub 1
    - sub 2
    - sub 3

    TLS A
    - sub a
    - sub b

    ... is there any functionality to test if the next section in the iteration is SectionLevel == 1 ..... eg it passes through "sub 3" and checks if the next pass "TLS A" is a top level section.

    The number of subsections varies.

    I can test if next sections exist but need to check the SectionLevel.

    Pointers, nudges or sparks of inspiration welcomed.


    Bikster
    SellerDeck Designs and Responsive Themes

    #2
    If it is a standard setup like that with no sub-sub sections, would list index not do it, because if list index equalled list count, it'd be safe to say that you are at the last sub? Failing that, check if section name next is null or not.

    EDIT: Yep, checking if SectionNameNext is empty will do it, should roll through til it hits the last sub and report an empty section then. I presume you want a different class applied? You then know from that point you are stepping up a level.

    Comment


      #3
      I need to insert some code at the end of the last (and every last) subsection... SectionNameNext == "" will only work on the very last subsection (I think... won't it?)

      ListIndex and ListCount both count the full number of sections and subsections and not just the sibling sections .. in my example above they would count 6 (starting at 0)

      I am currently playing putting the list on it's head and testing SectionSequence == 0 with a blockif to test SectionLevel == 2 and inserting the end of last subsection code into the SectionLevel == 1 ... excluding the first on the list



      Bikster
      SellerDeck Designs and Responsive Themes

      Comment


        #4
        SectionNameNext was working at sub level on the example I tried. I setup a couple of simple blockifs, one testing if it was null and one if it wasn't and i got it to output 'more' and 'no more' accordingly. It output more on every sub with a sub after it and no more on the last sub each time.

        Comment


          #5
          Update - SectionNameNext != "" does indeed test for the end of list at sub-section level... I went back to a blank layout and built it from scratch and now works as required.



          Bikster
          SellerDeck Designs and Responsive Themes

          Comment

          Working...
          X