Side bar category that opens up when clicked

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Side bar category that opens up when clicked

    I'm trying to develop a suitable navigation structure for
    my website, but I've gotten stumped trying to develop the
    navigation. I would like a side bar that list the
    categories then once a user clicks a category then it
    opens the pages within the category. Here is a link to
    what I want to accomplish.

    [url]http://demo.acuitycms.com/[/url]

    When you click on products and services, it opens up the
    products and services.

    My database schema:

    category
    catid int identity
    catTitle varchar(50)

    page
    pageID INT identity
    catID int references category(catID)
    pageTitle varchar(50)
    pageBody text

    Thanks and any insight would be appreciated.


    James Guest

  2. Similar Questions and Discussions

    1. Many-to-Many with Sub Category
      I have two linking tables, one for my main categories and one for sub categories with the many-to-many insert wizard applied to each. Works great on...
    2. Verity and Category
      I have a problem using category with Verity. My search form allows people to search in a collection of laws combining full-text searching and...
    3. Controls with a client side onLoad function or seting a cursor server side
      Is there any way to create a web control that calls a client side onLoad function? Its diffucilt since you are not able to access the form or...
    4. [PHP] Category and sub-category logic
      Ryan A <mailto:ryan@jumac.com> on Thursday, August 14, 2003 3:21 PM said: Read this http://www.sitepoint.com/article/1105 and you will know what...
    5. Category and sub-category logic
      Hi, I am thinking of making a program for personal use which does a very simple thing, just displays listings under categories, eg: under main...
  3. #2

    Default Side bar category that opens up when clicked

    OK, I think I figured it out. Can this code be
    optimized. What I am doing is checking if the categoryID
    from the request("categoryID") is <> "" then If it is I
    then run the code to display the pages within that
    category. Is there a better way to so I won't have to
    check, seems like I could use a join or something. Any
    insight let me know.

    ************ code start ********************
    <div id="links">
    <%
    CategoryID = trim(request("categoryID"))
    %>
    <ul>
    <%
    ' gets the links for the menu
    sql = "select catID, catTitle from category order by
    catID"
    set rs = Conn.execute(sql)
    do while not rs.eof %>
    <li>
    <a href="template.asp?CategoryID=<%=rs("CatID")%>"><% =rs
    ("catTitle")%></a>
    </li>
    <%
    if cint(rs("catID")) = cint(categoryID) then
    sql2 = "select catID, conID, pageTitle from content where
    catID = " & CategoryID & " order by catID"
    set rs2 = ADODBConn.execute(sql2)

    do while not rs2.eof %>
    <li class="test">
    <a href="template.asp?CategoryID=<%=rs2
    ("CatID")%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=r s2
    ("catTitle")%></a>
    </li><%
    rs2.movenext
    loop
    end if
    %>
    <%
    rs.movenext
    loop
    %>
    </ul>
    </div>
    ************ code end ********************
    >-----Original Message-----
    >I'm trying to develop a suitable navigation structure for
    >my website, but I've gotten stumped trying to develop the
    >navigation. I would like a side bar that list the
    >categories then once a user clicks a category then it
    >opens the pages within the category. Here is a link to
    >what I want to accomplish.
    >
    >[url]http://demo.acuitycms.com/[/url]
    >
    >When you click on products and services, it opens up the
    >products and services.
    >
    >My database schema:
    >
    >category
    >catid int identity
    >catTitle varchar(50)
    >
    >page
    >pageID INT identity
    >catID int references category(catID)
    >pageTitle varchar(50)
    >pageBody text
    >
    >Thanks and any insight would be appreciated.
    >
    >
    >.
    >
    James Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139