Announcement

Collapse
No announcement yet.

List of peer sections

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

    List of peer sections

    Is there any (simple) way to generate a list of peer sections in Actinic?

    i.e. if I'm a subsection of a parent, can I generate a list of section links to the other children of that parent?

    Thanks, Roger
    Roger Coathup
    Principal Consultant, 21 Thoughts Limited: futures inspired business consultancy
    Director, 21 Inspired Limited: website design and online services

    #2
    Interestingly, i'm just working on this. Here is an ugly solution.

    PHP Code:
    <actinic:block php="true" >
        
    $connect odbc_connect("ActinicCatalog8","","");
        
    $query "SELECT [nParentSectionID] FROM [Catalog Section] WHERE [nSectionID]=<actinic:variable name="SectionID" /> AND [bHideOnWebSite]=0 ORDER BY [Catalogue Section Sequence] ASC";
        
    $result odbc_exec($connect$query);
            while(
    odbc_fetch_row($result)){
                
    $nParentSectionID odbc_result($result1);
            }

        
    $query2 "SELECT [sPageName], [Section text], [nSectionID] FROM [Catalog Section] WHERE [nParentSectionID]=".$nParentSectionID." AND [bHideOnWebSite]=0 ORDER BY [Catalogue Section Sequence] ASC";
        
    $result2 odbc_exec($connect$query2);
        @
    odbc_fetch_row($result20);

            echo 
    "SiblingSections:<ul>";
            while(
    odbc_fetch_row($result2)){
            
            
    $sPageName odbc_result($result21);
                
    $Sectiontext odbc_result($result22);
                
    $nSectionID odbc_result($result23);
                echo 
    "<li><a href='".$sPageName."'>".$Sectiontext."</a></li>";
            }
            echo 
    "</ul>";
    </
    actinic:block

    Comment


      #3
      Thanks Gabriel, but unfortunately that's giving me a list of the parents (sections at a level above my current section).

      What I want is a list of all the sections at my level who share the same parent as me.
      Roger Coathup
      Principal Consultant, 21 Thoughts Limited: futures inspired business consultancy
      Director, 21 Inspired Limited: website design and online services

      Comment


        #4
        try again.
        lol.

        i left an extra upstream hop in there

        Comment


          #5
          Originally posted by RogerCoathup
          who share the same parent as me.
          your brothers?

          Comment


            #6
            hmmm, i'm sure that there is a better way to do this...

            Comment


              #7
              Yahoo section tree probably but it pains me to say it.

              Comment


                #8
                Hi ... revised code still just shows the parents (rather than the siblings) and is also throwing SQL errors. Thanks, Roger
                Roger Coathup
                Principal Consultant, 21 Thoughts Limited: futures inspired business consultancy
                Director, 21 Inspired Limited: website design and online services

                Comment


                  #9
                  What's the Yahoo section tree?

                  Thanks, Roger
                  Roger Coathup
                  Principal Consultant, 21 Thoughts Limited: futures inspired business consultancy
                  Director, 21 Inspired Limited: website design and online services

                  Comment


                    #10
                    you basically want the other members of the current parent. this is what it gives you.

                    the errors are a result of a bug in actinic. press the single page preview button on the toolbar and turn the preview off, its crap-tacular.

                    works for me: http://www.asylumunlimited.co.uk/acatalog/Shoes.html

                    (white box)

                    Comment


                      #11
                      Hi Gabriel...

                      Yes, that's working for me now. Thanks, your help is much appreciated.

                      Best regards, Roger
                      Roger Coathup
                      Principal Consultant, 21 Thoughts Limited: futures inspired business consultancy
                      Director, 21 Inspired Limited: website design and online services

                      Comment


                        #12
                        a recent error i found prohibits some php content type shops from snapshotting.

                        try to take a snapshot to a fresh filename. and let me know what happens.

                        Comment


                          #13
                          What's the Yahoo section tree
                          You dont want to go there

                          Comment


                            #14
                            becasue this solution causes my system to crash wth some odd error when i exit actinic, exporting your catalog when you attempt it, due to some odd locking semnatics on the database.

                            dont use this in a production shop. please.

                            Comment


                              #15
                              close the odbc connection.
                              add

                              odbc_Close($connect);

                              at the very end before closing the php block.
                              that should fix it

                              Comment

                              Working...
                              X