Announcement

Collapse
No announcement yet.

parent sections javascript array

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

    parent sections javascript array

    hi,

    can anyone tell me the correct term to use if i wanted to display just the parent sections rather than the child sections...this is different to the top level sections as i have created thumbnails for the products...i was guessing it was something to do with changing the "child_sections" to something else but i wasnt sure what and ive tried a few variations which dont really work....guessing dosent seem to work with scripting

    the display script i have is:-

    <script language=Javascript1.1>
    document.write(SectionList(child_sections))
    </script>


    many thanx to anyone who can help.

    Kind regards

    John

    #2
    John,

    You would need to change (SectionList(child_sections)) to (SectionList(sections))

    Kind regards,
    Bruce King
    SellerDeck

    Comment


      #3
      Hi Bruce,

      thanx for the reply however ive tried that but it just stops any array displaying...do i need to change anything in the other part of the code?..the code i have is below

      <actinic:variable name="JavaScriptSubSectionArray" value="List Of All Data From Sub Sections" />

      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function SectionList(ar){
      var strIDs = '';
      for (var i=1;i<=ar.length;i++){
      if (ar[i].sURL !=null){
      strIDs += '<table width="160" height="0" border="0" cellpadding="0" cellspacing="0"><tr><td width="15" valign="top"><img src="http://www.kbbappliances.co.uk/images/arrow_15.gif" width="20" height="9"></td><td><a href="' + ar[i].sURL + '">' + ar[i].sName + '</a><br /></td></tr></table>';
      {
      if (ar[i].pChild){
      for (var j=1;j<=ar[i].pChild.length;j++){
      if (j <= ar[i].pChild.length){
      strIDs += '<br />';
      }
      }
      }
      }
      }
      }
      strIDs += '<br />'
      return strIDs
      }

      function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
      }

      function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
      }

      function MM_findObj(n, d) { //v4.01
      var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
      }

      function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
      if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
      }
      //-->
      </SCRIPT>


      many thanx for your help

      kind regards

      John

      Comment


        #4
        John,

        This is what you need to do

        1. Change value="List Of All Data From Sub Sections" to All Data From Top Level Sections. This is done by right clicking on the layout selector and choose 'Fixed layout' from 'Edit Appearance'.

        2. Remove the portion :
        {
        if (ar[i].pChild){
        for (var j=1;j<=ar[i].pChild.length;j++){
        if (j <= ar[i].pChild.length){
        strIDs += '&nbsp;';
        }
        }
        }
        }

        3. change (SectionList(child_sections)) to (SectionList(sections)) Like I asked you to do earlier.

        Kind regards,
        Bruce King
        SellerDeck

        Comment


          #5
          Hi Bruce,

          Thanx for the reply, didnt realise i had to amend the other bit however ive done that but it only then displays the top level sections...Im trying to get just the parent sections.

          Basically, I have top level sections of Teka, Kuppersbuch & Special offers which with the script I have list their subsections nicely http://www.kbbappliances.co.uk/acatalog/Teka.html however if you use this code for the subjections it gives this http://www.kbbappliances.co.uk/acata..._in_Ovens.html where as i wanted it to display the same list and if you go to the product is dosent display anything http://www.kbbappliances.co.uk/acata...OHC490_WH.html where as i would also like this to display the same as the http://www.kbbappliances.co.uk/acatalog/Teka.html page.

          Since adding the posting I asked Actinic and they said "From checking the source on your site, it seems that you have the javascript code embedded into each of the sections and also its sub-sections. What you would need to do is to have an overall layout with this code and have your subsections use this layout so that the links being generated display only the main sub-sections. The code is working as it should, just that you would need to have this code on the top level alone to make it work the way you want it to"

          I have no idea how to do this...have asked actinic if they can expand on how to do this but waiting for a reply...would be very grateful of any direction you can give.

          many thanx again

          Kind regards

          John

          Comment

          Working...
          X