Announcement

Collapse
No announcement yet.

Inserting The Top-Level Section in Large Font, With the Sub-Sections Listed Underneat

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

    Inserting The Top-Level Section in Large Font, With the Sub-Sections Listed Underneat

    This code will create a section list in the following style:

    It only covers a single depth of subsections, but it is an attractive way to display your sections to your customers.
    1. To begin, insert the following code into the <HEAD></HEAD> section of the overall layout template(s):
    <!--@actNETQUOTEVAR:SECTIONTREE_RAW-->

    I am confused exactly where to paste the code. I may be having a brain lapse, but what FILE do I paste this code into?


    BTW, I am getting this from page 45 in the advanced users guide.


    Thanks,

    Jonathan

    #2
    That will be Act_Primary.html (in your Site1 folder). Look for the </HEAD> line and paste it in above there.

    Norman

    p.s. I couldn't find anything relevant on P45 of my AUG. Actinic keep revising it and one of us may have an older version.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Norman,

      I have tried all combinations to make this work, I think I remember someone else on this site commenting about this not working, but basically I would like to have a layout such as

      HEADING 1
      subsection 1, subsection 2, subsection 3
      subsection 4.....

      HEADING 2
      subsection 1, subsection 2, subsection 3
      subsection 4.....

      For my index page. I also told you wrong, it is on page 45 of the Designing with Actinic Developer starter guide.

      Thanks for your help.

      Jonathan

      Comment


        #4
        To save any script conflicts, get rid of any Javascript code you have added to far to your design when trying to get this working, and then do the following:

        Locate the line

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

        in your Act_Primary.html template. Right underneath it, add:

        Code:
        <!--@act NETQUOTEVAR:SECTIONTREE_RAW -->
        
        <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
        <!--
        function YahooSections(ar)
        {
        var strIDs = '';
        for (var i=1;i<=ar.length;i++)
          {
          if (ar[i].sURL !=null)
            {
            strIDs += '<a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';
              {
              if (ar[i].pChild)
                {
                for (var j=1;j<=ar[i].pChild.length;j++)
                  {
                  if (j < ar[i].pChild.length)
                    {
                    strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ';
                    }
                  else
                    {
                    strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ...';
                    }
                  }
                }
              }
            strIDs += '<br><br>'
            }
          }
        return strIDs
        }
        //-->
        </SCRIPT>
        Then, wherever you want the list to appear, add the following into the HTML:

        Code:
        <script language=Javascript1.2>
        	document.write(YahooSections(section_tree)) 
        </script>

        Comment


          #5
          Chris,

          Worked like a champ, THANKS!

          How would you change the Font Colors for each subsection listing so that longer list are easier to read?

          Also, is it possible to have the MAIN heading as a Title and Image, and then subsections as text?

          Thanks so much,

          Jonathan

          Comment


            #6
            I don't know how to get different links as different colours, but for the image headings, you can include code for the section images in the javascript.

            Replace the line:

            Code:
            strIDs += '<a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';
            with:

            Code:
            strIDs += '<a href=' + pItem[i].sURL + '><img src="' + pItem[i].sImage + '" alt="'+ pItem[i].sName + '" width=' + pItem[i].nImageWidth + ' height=' + pItem[i].nImageHeight + ' border=0></a> <a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';

            Comment


              #7
              I replaced the code and it doen't seem to work. See if you see something wrong in here...

              <!-- Primary HTML begin -->
              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
              <HTML>
              <HEAD>
              <TITLE>
              NETQUOTEVAR:PAGETITLE NETQUOTEVAR:PAGEHEADER
              </TITLE>
              <Actinic:BASEHREF VALUE="NETQUOTEVAR:BASEHREF"/>
              <META NAME="ACTINICTITLE" CONTENT="NETQUOTEVAR:PAGEHEADER">
              <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
              <!--@act NETQUOTEVAR:HEADERMETA -->
              <!--@act NETQUOTEVAR:LOADFUNCTION -->
              <!--@act NETQUOTEVAR:SUBMITFUNCTION -->
              <!--@act NETQUOTEVAR:P3PFULLPOLICYLINK -->
              <LINK REL=STYLESHEET HREF="actinic.css">


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

              <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
              <!--
              function YahooSections(ar)
              {
              var strIDs = '';
              for (var i=1;i<=ar.length;i++)
              {
              if (ar[i].sURL !=null)
              {
              strIDs += '<a href=' + pItem[i].sURL + '><img src="' + pItem[i].sImage + '" alt="'+ pItem[i].sName + '" width=' + pItem[i].nImageWidth + ' height=' +

              pItem[i].nImageHeight + ' border=0></a> <a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';

              {
              if (ar[i].pChild)
              {
              for (var j=1;j<=ar[i].pChild.length;j++)
              {
              if (j < ar[i].pChild.length)
              {
              strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ';
              }
              else
              {
              strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ...';
              }
              }
              }
              }
              strIDs += '<br><br>'
              }
              }
              return strIDs
              }
              //-->
              </SCRIPT>


              <!-- Placeholder of cookie checking javascript code. Do not remove it! -->
              <Actinic:COOKIECHECK/>

              <!--
              The NETQUOTEVARs below can be uncommented for getting raw section lists:
              1. Top level section list
              2. Section list from current level and all children
              3. The whole section tree
              The rest covers the standalone structure members for each array - e.g. if
              you only need sName or sURL from an array.
              See the documentation for details.

              NETQUOTEVAR:TOPLEVELSECTIONS_RAW
              NETQUOTEVAR:CHILDSECTIONS_RAW
              NETQUOTEVAR:SECTIONTREE_RAW

              NETQUOTEVAR:SECTIONTREE_NAMES
              NETQUOTEVAR:SECTIONTREE_URLS
              NETQUOTEVAR:SECTIONTREE_IMAGES
              NETQUOTEVAR:SECTIONTREE_IMAGEWIDTHS
              NETQUOTEVAR:SECTIONTREE_IMAGEHEIGHTS
              NETQUOTEVAR:SECTIONTREE_SECTIONIDS

              NETQUOTEVAR:TOPLEVELSECTIONS_NAMES
              NETQUOTEVAR:TOPLEVELSECTIONS_URLS
              NETQUOTEVAR:TOPLEVELSECTIONS_IMAGES
              NETQUOTEVAR:TOPLEVELSECTIONS_IMAGEWIDTHS
              NETQUOTEVAR:TOPLEVELSECTIONS_IMAGEHEIGHTS
              NETQUOTEVAR:TOPLEVELSECTIONS_SECTIONIDS

              NETQUOTEVAR:CHILDSECTIONS_NAMES
              NETQUOTEVAR:CHILDSECTIONS_URLS
              NETQUOTEVAR:CHILDSECTIONS_IMAGES
              NETQUOTEVAR:CHILDSECTIONS_IMAGEWIDTHS
              NETQUOTEVAR:CHILDSECTIONS_IMAGEHEIGHTS
              NETQUOTEVAR:CHILDSECTIONS_SECTIONIDS

              The section level can be accessed through:
              NETQUOTEVAR:SECTIONLEVEL
              -->

              <!--
              The NETQUOTEVARs below can be uncommented and moved to the appropriate

              location
              to save and load shopping lists
              <A HREF="NETQUOTEVAR:SAVECARTURL"><FONT FACE=ARIAL SIZE=-1><I><B>Save

              Shopping List</B></I></FONT></A>
              <A HREF="NETQUOTEVAR:RESTORECARTURL"><FONT FACE=ARIAL SIZE=-1><I><B>Load

              Shopping List</B></I></FONT></A>
              --->

              </HEAD>

              <BODY NETQUOTEVAR:BGIMAGE OnLoad="NETQUOTEVAR:ONLOAD" NETQUOTEVAR:BGCOLOR TEXT="NETQUOTEVAR:FGCOLOR" NETQUOTEVAR:LINKCOLOR NETQUOTEVAR:VLINKCOLOR

              NETQUOTEVAR:ALINKCOLOR marginwidth="5" marginheight="5">
              <table width="100%" border="0" cellspacing="0" cellpadding="5" background="palette2bg.gif">
              <tr>
              <td>NETQUOTEVAR:LOGOIMAGE</td>
              <td align="right"> NETQUOTEVAR:SIMPLESEARCH&nbsp;</td>
              </tr>
              </table>
              <table width="100%" border="0" cellspacing="0" cellpadding="5" background="palette1bg.gif">
              <tr>
              <td>&nbsp;</td>
              <td align="right">NETQUOTEVAR:FOOTERGUIDE&nbsp;</td>
              </tr>
              </table>

              <table width="100%" border="0" cellspacing="0" cellpadding="5" height="100%">
              <tr>
              <td background="palette3bg.gif" valign="top" width="160"><br>
              NETQUOTEVAR:TOPLEVELSECTIONSTOP<br>
              <br>
              <table width="100" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
              <td bgcolor="NETQUOTEVAR:FGCOLORCSS">
              <div align="center"> <span class="actxxsmall"> <font color="NETQUOTEVAR:BGCOLORCSS">
              <script language="JavaScript">
              document.write("NETQUOTEVAR:CARTCOOKIEITEMS&nbsp;" + getCartItem(3)+"&nbsp;<BR>");
              document.write("NETQUOTEVAR:CARTCOOKIEVALUE&nbsp;" + getCartItem(1));
              </script>
              </font></span> </div>
              </td>
              </tr>
              </table>

              </td>
              <td valign="top">
              <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="CUSTOMVAR:ACTSTDWIDTH" ALIGN="CENTER">
              <TR>
              <TD VALIGN="MIDDLE" ALIGN="LEFT" >
              NETQUOTEVAR:FORMBEGIN
              <A NAME="top"><INPUT TYPE=HIDDEN NAME=RANDOM VALUE="NETQUOTEVAR:RANDOM"></A>
              NETQUOTEVAR:HIDDENFIELDS
              <!-- If customer accounts are in operation following two lines allow displaying -->
              <!-- User name and customer account name on every page -->
              <!-- NETQUOTEVAR:LOGINLINK --><Actinic:NOWSERVING/>
              <Actinic:CURRACCOUNT/><Actinic:LOGOUT_SIMPLE/><br>
              <!-- NETQUOTEVAR:HEADER -->
              <span class="actxsmall">NETQUOTEVAR:HEADERTEXT<br><br></span>
              NETQUOTEVAR:BULK <br><br>
              <span class="actxsmall">NETQUOTEVAR:FOOTERTEXT</span>
              <!-- NETQUOTEVAR:FOOTER -->
              NETQUOTEVAR:FORMEND<br>
              </TD></TR>
              </TABLE>
              </td>
              </tr>
              </table>

              </BODY>
              </HTML>
              <!-- Primary HTML end -->

              Comment


                #8
                Could you maybe save your Act_Primary.html as a text file and attach it to the posting.

                In the code you put up there it looks like you have two line breaks after

                strIDs += '<a href=' + pItem[i].sURL + '><img src="' + pItem[i].sImage + '" alt="'+ pItem[i].sName + '" width=' + pItem[i].nImageWidth + ' height=' +

                and after

                pItem[i].nImageHeight + ' border=0></a> <a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';

                They should be on one line.

                Comment


                  #9
                  Plus you have not got

                  <script language=Javascript1.2>
                  document.write(YahooSections(section_tree))
                  </script>


                  in that file - but I have just tried it myself and got a script error.

                  Comment


                    #10
                    Right - got it working.

                    Use this code in the <head> section in place of that other code I sent you:

                    Code:
                    <!--@act NETQUOTEVAR:SECTIONTREE_RAW -->
                    
                    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                    <!--
                    function YahooSections(ar)
                    {
                    var strIDs = '';
                    for (var i=1;i<=ar.length;i++)
                    {
                    if (ar[i].sURL !=null)
                    {
                    strIDs += '<a href=' + ar[i].sURL + '><img src="' + ar[i].sImage + '" alt="'+ ar[i].sName + '" width=' + ar[i].nImageWidth + ' height=' + ar[i].nImageHeight + ' border=0></a><a href="' + ar[i].sURL + '"><span class="actregular">' + ar[i].sName + '</span></a><br>';
                    {
                    if (ar[i].pChild)
                    {
                    for (var j=1;j<=ar[i].pChild.length;j++)
                    {
                    if (j < ar[i].pChild.length)
                    {
                    strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ';
                    }
                    else
                    {
                    strIDs += '<a href="' + ar[i].pChild[j].sURL + '"><span class="actxsmall">' + ar[i].pChild[j].sName + '</span></a>, ...';
                    }
                    }
                    }
                    }
                    strIDs += '<br><br>'
                    }
                    }
                    return strIDs
                    }
                    //-->
                    </SCRIPT>

                    Comment


                      #11
                      OK GREAT!! It works, now I think one last request, and then I am probably out of favors. Is it possible to make these line up in columns? Meaning the layout of section list, I would like to have 3 columns in every row if that makes since.

                      Thanks and Thanks again (Really),

                      Jonathan

                      Comment


                        #12
                        Are you talking about the sub-section list that appears in the main body of the page? Columns for this are controlled in 'Design | Options | Sections'.

                        If you are talking about the javascript links I have given you above, then I am utterly cluless I'm afraid. Sorry.

                        Comment


                          #13
                          Originally posted by cdicken

                          If you are talking about the javascript links I have given you above, then I am utterly cluless I'm afraid. Sorry.

                          Yes I was talking about the javascript links. The page looks great but I could make it more compact If I could get it to at least 2 colums. Look at this site for an example www.mcmaster.com . When we finish our catalog we will have over 10,000 products, and there are more than 1,000 html pages generated. So far the layout is clean and very basic and simple, but it is requiring a lot of clicks to get around. Actinic is still running extremly fast, which is a huge plus. I put Normans Cascade menu in and tested it, but unfortunately, with so many pages and long page names it slowed the site down considerably. Also, I do want to thank you for ALL your help with this, you have done way more than expected.

                          Sincerely,

                          Jonathan

                          Comment


                            #14
                            I put Normans Cascade menu in and tested it, but unfortunately, with so many pages and long page names it slowed the site down considerably.
                            Did you try NorCascade. This uses the same sectiontree files (so no file size reduction there) but is more efficient at displaying the menus. It's at www.rouxel.cwc.net/actinicstuff.html

                            The older NorTree could be very slow on large sites especially if you used the little navigation triangles as a bug in Internet Explorer (bet you didn't know it had any bugs ) meant that the same image was repeatedly reloaded from the server every time it occurred on the menu (even on sections that were not yet visible).

                            Norman
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #15
                              Originally posted by NormanRouxel
                              Did you try NorCascade. This uses the same sectiontree files (so no file size reduction there) but is more efficient at displaying the menus. It's at www.rouxel.cwc.net/actinicstuff.html

                              The older NorTree could be very slow on large sites especially if you used the little navigation triangles as a bug in Internet Explorer (bet you didn't know it had any bugs ) meant that the same image was repeatedly reloaded from the server every time it occurred on the menu (even on sections that were not yet visible).

                              Norman
                              Norman,

                              Yes it was Norcascade Popup menu creator V1.02. My site would load, and then 5-10 seconds later the menu would load and that was on a T1 connection. The tool is great and I would love to still use it, but alot of my customers are not going to have high speed connections and I want to keep the site as fast as possible. As far as functionality, and ease of use I would recommend it to anyone. My problem may of been, the fact that:
                              Act_section_tree_names.js was 111kb and
                              Act_section_tree_URLs.js was 122kb.

                              If I shorten all my page names considerably will it speed up?

                              I have one last question for you Norman, do you know how to make the above javascript function that cdicken has been working on align in 2 columns, such as that on www.mcmaster.com? Thanks for your help.

                              Sinerely,

                              Jonathan

                              Comment

                              Working...
                              X