Announcement

Collapse
No announcement yet.

In the frame.....

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

    In the frame.....

    Hi

    I have a script which writes a site map in a cell to the left of the catalogue body, but the resulting map is soooooo looong that it's a bit unmanagable.

    I am trying to get this sitemap to appear in a frame instead (barring basket and checkout) with not much joy. I still need the usual Nav items and basket totals to appear on the right.


    Can anyone help here?



    Steve

    #2
    PS: The web address is:

    http://www.gearshift.co.uk/acatalog/index.html

    The map is now on the right, but it still needs to be independant of the body of the catalogue...

    Any clues at all..?

    Steve

    Comment


      #3
      Hmmm - I suggest renaming the 'Base Page Name' in 'Design | Options | Shop Defaults' to 'catalogbody.html' and then creating an 'index.html' file which creates a frameset which loads 'catalogbody.html' into the main frame and then 'sectionlist.html' (or whatever) into the side frame.

      You can then upload 'index.html' and 'sectionlist.html' via 'Advanced | Additional Files'.

      Finally, in 'Design | Options | Misc' select 'No Frames in Checkout' and then create a new custom property in 'Advanced | Custom Properties' called 'ACT_SETUP_FRAMES_OFF' to ensure the custom frameset is removed in the checkout.

      Comment


        #4
        Hi Chris

        Thanks for that, s'great.
        Only one problem. The script that generates the listing on the right does not seem to work in the left hand frame.
        The script came from the advanced users guide:


        "....Creating a Bulletted List containing the Top-Level Sections
        and Sub-Sections
        This will basically create a full site map anywhere.

        Enter the following into the <HEAD></HEAD> tags of the page (towards the bottom of the
        <HEAD> section)

        <!--@act NETQUOTEVAR:SECTIONTREE_RAW -->

        Then enter the following code into the main body of the page where you want the sitemap to
        appear:

        <SCRIPT LANGUAGE = JavaScript>
        <!--
        function Recurse(pItem)
        {
        for (var i = 1; i <= pItem.length; i++)
        {
        document.write("<UL>");
        document.write("<LI>");
        document.writeln(pItem[i].sName.link(pItem[i].sURL));
        document.write("</LI>");
        if (pItem[i].pChild)
        {
        Recurse(pItem[i].pChild);
        }
        document.write("</UL>");
        }
        }
        Recurse(section_tree);
        -->
        </SCRIPT>
        ..."

        Can you see anything obvious that I am doing wrong?

        Any further help appreciated!

        Steve Robertson

        Comment


          #5
          PS:

          Have tried using sitemap.html as source for L/H frame, but of course it opens the content in the L/H frame as well, not the R/H one. Will this not happen with anything I put in the L/H frame?
          Is there a way 'round this?

          Are there any headache tablets in the cupboard?

          I think what I need to know is:

          1) Does this script from the guide work in a frame by itself? (ie as a standalone page?)

          2) Can it be adjusted so that it targets Chris's suggested "catalogbody.html"?

          Sorry if any of the answers are stupidly obvious, but I'm really out of my depth here....

          If anyone wants to see where I've got to (hey, why not, I'm sure you could do with a laugh!) visit:
          http:www.gearshift.co.uk/acatalog/index.html
          It's a mess at the moment, but it's home....


          Steve Robertson

          Comment


            #6
            Have tried using sitemap.html as source for L/H frame, but of course it opens the content in the L/H frame as well, not the R/H one. Will this not happen with anything I put in the L/H frame?
            Have you ever used frames before? You should probably do some reading up on them.

            When you create a 'frameset' document you give each frame a name e.g. 'main', 'navbar' etc. Then in the links within your site you can give the link a target to ensure that the link opens where you want it to e.g.

            <a href="..." target=main>

            etc.

            1) Does this script from the guide work in a frame by itself? (ie as a standalone page?)
            Yes.

            Add

            <SCRIPT LANGUAGE="JavaScript" SRC="actiniccore.js" TYPE="text/javascript"></SCRIPT>
            <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>
            <!--@act NETQUOTEVAR:SECTIONTREE_RAW -->

            into the <head></head> section of your custom page, together with the JavaScript for building the section list itself.

            In the code for the links within the JavaScript, add in a target=main (or whatever) into the <a> tags.

            Comment


              #7
              Thanks Chris

              Yes, I know nothing.
              It shows doesn't it?

              Have now done some homework on frames.

              I understand that you need to set a target for the link to open in, but the bits that still trip me up are:

              The actual script not having any <a> tags anywhere to set a target in.

              The fact that I still can't get the script to generate a site map (see http://www.gearshift.co.uk/acatalog/quicknavTEST.html for the page being used as the navigation frame)
              I'm fairly certain I've followed the instructions, but then again I am a bit green....

              Any further help for an (apparent) idiot?

              Steve Robertson

              Comment


                #8
                Wait a minute.....

                Have just added:

                <SCRIPT LANGUAGE="JavaScript" SRC="Act_sections.js" TYPE="text/javascript"></SCRIPT>

                &

                <SCRIPT LANGUAGE="JavaScript" SRC="Act_section_tree.js" TYPE="text/javascript"></SCRIPT>

                as well and now the sitemap generates (see http://www.gearshift.co.uk/acatalog/index.html)

                Still having problems identifying a method of targeting "catalogbody.html" for the links generated though due to no <a> tags and a huge lack of experience (!)

                Steve

                Comment


                  #9
                  Look in the JavaScript code that actually draws the list e.g.

                  <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                  <!--
                  function SectionList(ar)
                  {
                  var strIDs = '<table border=0 width=95% cols=2>';
                  for (var i=1;i<=ar.length;i++)
                  {
                  if (ar[i].sURL !=null)
                  {
                  strIDs += '<tr><td colspan=2><a href="' + ar[i].sURL + '"><span class="actxxsmall">' + ar[i].sName + '</span></a></td></tr>';
                  {
                  if (ar[i].pChild)
                  {
                  for (var j=1;j<=ar[i].pChild.length;j++)
                  {
                  if (j <= ar[i].pChild.length)
                  {
                  strIDs += '<tr><td><img src=shim.gif width=5></td><td><a href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].sName + '</span></a></td></tr>';
                  }
                  }
                  }
                  }
                  }
                  }
                  strIDs += '</table>'
                  return strIDs
                  }
                  //-->
                  </SCRIPT>

                  Notice that there is just standard HTML in amongst the scary JavaScript

                  <a href="' + ar[i].sURL + '">

                  change this to

                  <a href="' + ar[i].sURL + '" target=main>

                  Changing 'main' to whatever name you have given the main frame where the store appears.

                  Comment


                    #10
                    Thanks for the help Tim..

                    Which script is this?

                    Look in the JavaScript code that actually draws the list e.g.

                    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                    <!--
                    function SectionList(ar)
                    {
                    var strIDs = '<table border=0 width=95% cols=2>';
                    for (var i=1;i<=ar.length;i++)
                    {
                    if (ar[i].sURL !=null)
                    {
                    strIDs += '<tr><td colspan=2><a href="' + ar[i].sURL + '"><span class="actxxsmall">' + ar[i].sName + '</span></a></td></tr>';
                    {
                    if (ar[i].pChild)
                    {
                    for (var j=1;j<=ar[i].pChild.length;j++)
                    {
                    if (j <= ar[i].pChild.length)
                    {
                    strIDs += '<tr><td><img src=shim.gif width=5></td><td><a href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall">' + ar[i].pChild[j].sName + '</span></a></td></tr>';
                    }
                    }
                    }
                    }
                    }
                    }
                    strIDs += '</table>'
                    return strIDs
                    }
                    //-->
                    </SCRIPT>
                    The one I am using to generate the list (pg 36, v6 Advanced user guide) is different and a lot shorter:

                    <SCRIPT LANGUAGE = JavaScript>
                    <!--
                    function Recurse(pItem)
                    {
                    for (var i = 1; i <= pItem.length; i++)
                    {
                    document.write("<UL>");
                    document.write("<LI>");
                    document.writeln(pItem[i].sName.link(pItem[i].sURL));
                    document.write("</LI>");
                    if (pItem[i].pChild)
                    {
                    Recurse(pItem[i].pChild);
                    }
                    document.write("</UL>");
                    }
                    }
                    Recurse(section_tree);
                    -->
                    </SCRIPT>
                    I take your point about the HTML in your example, but can see none in mine. Am I concentrating on the wrong thing?

                    Steve Robertson

                    Comment


                      #11
                      I got my code from the latest v7 AUG - which is basically the same as the v6 one when it comes to these section lists.

                      p38 Creating a List of Hyperlinks with Sections and Sub-sections

                      I don't know how to add the target into the JavaScript you mention - that came from one of the developers and I have never really understood it!

                      Comment


                        #12
                        Thanks for your help Chris

                        I've tried using the other scripts from the AUG (v6) and also
                        p38 Creating a List of Hyperlinks with Sections and Sub-sections
                        from AUG v7 all to no avail.
                        (See http://www.gearshift.co.uk/acatalog/...risDicken.html for how this one has turned out)


                        My example is the only one that seems to work...albeit without being able to target the right frame

                        Have read and re-read the AUGs to see if I am missing something but don't seem to be.

                        Can you throw any light on this at all?

                        Sorry to be an on-going nuisance(!)


                        Steve Robertson

                        Comment


                          #13
                          I have managed to get it working.... Not sure what the problem was.

                          Please see the attached...
                          Attached Files

                          Comment


                            #14
                            Aha!

                            Thanks for fixing that, much appreciated!

                            Targetting still a problem though.

                            Having followed your example through, the only thing I can get to happen is a new "_blank" window, as if a target cannot be resolved...
                            (see http://www.gearshift.co.uk/acatalog/index.html)

                            Any ideas?

                            Steve Robertson

                            Comment


                              #15
                              Hmmm... you have done everything correctly as far as I can tell.

                              You could try changing
                              target=mainFrame
                              to
                              target="mainFrame"

                              and see if that makes a difference.

                              I'm hoping this isn't some strange incompatibility between JavaScript and frames but I'm not sure.

                              Comment

                              Working...
                              X