Announcement

Collapse
No announcement yet.

Search - section dropdown

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

    Search - section dropdown

    Hi,
    I'm sure this one's been answered somewhere, but I can't see it for looking. Is there a way of getting the "search by section" dropdown to list only sections and not sub-sections? I have too many sub-sections, and many of them are just the same product repeated.
    Thanks.

    #2
    Hi Tim,

    I got this going by using the "Creating a Drop-Down List Containing the Top-Level Sections" code from the Advanced User Guide.

    Open Act_SearchTemplate.html with Notepad and change the following code from:

    <tr>
    <td colspan=2 valign="BOTTOM"> <b>NETQUOTEVAR:SECTIONCONTROLLABEL</b><br>
    NETQUOTEVAR:SECTIONCONTROL </td>
    </tr>
    <tr>

    To:

    <tr>
    <td colspan=2 valign="BOTTOM"> <b>NETQUOTEVAR:SECTIONCONTROLLABEL</b><br><form name="Act_SectionDroplist">
    <script language=Javascript1.1>document.write(ACT_DropListBox(sections))</script>
    </form>

    <!--NETQUOTEVAR:SECTIONCONTROL --></td>
    </tr>

    Now edit your overall layout template (usually Act_Primary.html) and insert the following code:


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

    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    /***********************************************************************
    *
    * ACT_DropListBox - returns a string containing the HTML for the SELECT listbox
    *
    ************************************************************************/

    function ACT_DropListBox(ar)
    {
    var strIDs = '<SELECT SIZE="1" NAME="ACT_droplstbox" onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">'
    var sel = " SELECTED"
    strIDs += '<OPTION ' + sel + ' VALUE="">Select a Section</OPTION>'
    for (var i=1;i<=ar.length;i++)
    {
    if (ar[i].sURL !=null)
    {
    strIDs += '<OPTION VALUE="' + ar[i].sURL + '">' + ar[i].sName + '</OPTION>'
    }
    }
    strIDs+='</SELECT>'
    return strIDs
    }
    //-->
    </SCRIPT>


    Within the <head> tags.

    I hope this helps.
    Regards,

    Toby Blanchard

    Comment


      #3
      Toby,
      Many thanks for that.
      Tim

      Comment

      Working...
      X