Announcement

Collapse
No announcement yet.

Can I check if a sub section is the first or last sub within a section

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

    Can I check if a sub section is the first or last sub within a section

    Hi - does anyone know how to check if a sub section is the first or last sub section within a section?
    Regards
    David

    #2
    Yes you can use 'listcount' and 'listindex' and just compare the values using some maths to do what you want. These are provided as standard variables in actinic.

    Comment


      #3
      Thanks Lee
      Regards
      David

      Comment


        #4
        Caution if using ListCount. See http://community.actinic.com/showthread.php?p=215752 for a bug report. This refers to Product lists but check you're getting expected behaviour in Section lists.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Another technique that might work is to use variables SectionNamePrev and SectionNameNext. They're null if on the first or last sibling-level Sections respectively.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Cheers Norman - that is even a better solution for what I want to do.

            Has anybody else had the same same issue when SectionNamePrev and SectionNameNext are null when displayed in IE6. Instead of linking to the present page it links through to the previous level.

            e.g. on this page: http://http://www.seasaltcornwall.co..._cochineal.php
            on IE6 the previous link links to http://www.seasaltcornwall.co.uk/acatalog/ yet on other browsers it links to http://www.seasaltcornwall.co.uk/aca..._cochineal.php correctly.
            Regards
            David

            Comment


              #7
              It fails on IE7 too - as expected since Actinic generates static HTML.

              You have

              Code:
              <a href="">< previous</a> || <a href="hearsay_tee_shirt_teal.php">next ></a>
              It looks like you've forgot to put a COndition areound these links.

              E.g. (pseudo code).

              Code:
              block if=SectionNamePrev != ""
              <a href="SectionNamePrev">Prev</a> || 
              /block
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment

              Working...
              X