|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Money talks. Will pay for this!!!! £20?
Ok guys I have tried and tried and again tried to sort this out with no luck. I just cannot get my head around this problem, and I need it done urgently.
So here goes. I will pay to have this problem fixed as its eating up all my time trying to get it sorted. I have it all ready in a zip using a dnsless connection. All you have to do is fullfill my requirements with the asp function again all ready and prepared. My issue as below: Clicking say alliances and partners which is a top level element. I get a series of level two items. Fine This is done using this call: Code:
<% Call subNavigation(4) %> Because the level one is not going to be client editable I can hardcode the value, i.e 4 is the alliances and partners section and so on. Clicking say one of the links in alliances and partners, the following are parented to this item: 1. Associated Investment Funds (id=18) 2. Special Purpose Vehicles (id=19) 3. Partners (id=20) 4. equitySURE (id=21) 5. Links (id=22) Clicking on a level 2 item shows the level 3 items which is fantastic so far. So now this is my issue. When I click on a level 3 navigation the ID is loaded fine but the navigation level 3s are no longer showing, so the navigation collapses to level 2 despite being on a level three item. I hope this makes sense. My code is below:- Code:
<%
'GET SUB NAVIGATION
Dim sChild, sViewChild
Sub SubNavigation(sParent)
Call openConnection
sChild = Request.QueryString("pid")
Set oRS = oConn.Execute ("SELECT ID, ParentID, Title FROM tblNavigation WHERE ParentID = " & sParent & ";")
If Not oRS.EOF Then
Response.Write "<ul>"
Do While Not oRS.EOF
'If sChild has sub element then output selected without the closing </li> otherwise do!
If sChild <> "" AND CInt(sChild) = CInt(oRS("ID")) Then
Response.Write Space(2) & "<li><a href=""default.asp?pid=" & oRS("ID") & """ class=""many"">" & oRS("Title") & "</a>"
Else
Response.Write Space(2) & "<li><a href=""default.asp?pid=" & oRS("ID") & """>" & oRS("Title") & "</a></li>"
End If
If sChild <> "" AND CInt(sChild) = CInt(oRS("ID")) Then
Set sViewChild = oConn.Execute("SELECT * FROM tblNavigation WHERE ParentID = " & sChild)
Response.Write "<ul>"
Do While Not sViewChild.EOF
Response.Write "<li><a href=""default.asp?pid=" & sViewChild("ID") & """>" & sViewChild("Title") & "</a></li>"
sViewChild.MoveNext
Loop
Response.Write "</ul></li>"
End If
oRS.MoveNext
Loop
Response.Write "</ul>"
End If
Call closeConnection
End Sub
%>
And the files are attached. |
|
#2
|
|||
|
|||
|
Come on guys, how about £40. Cannot go any higher!
Surely someone knows how to do this???????????????
|
|
#3
|
|||
|
|||
|
Quote:
Do you care if you setup your file structure like this: /about_us/core_values/thirdLevel.asp Rather than using: /about_us/default.asp?pid=7 I think this will make your navigation much easier, plus, better for SEO (search engine optimization) and indexing on the engines. |
|
#4
|
|||
|
|||
|
Quote:
Hi BLarche, the problem with that is that my pages would be hardcoded, the reason I am using the querystring is to load the id for each page. If you can suggest a better way of me approaching this then that would help. If a client adds a new page in my cms, it will add a new record in the table with a new id. If you can suggest how I would make my pages dynamic for the client using the method you suggest then please let me know. Cheers Trev |
|
#5
|
|||
|
|||
|
Quote:
Your pages will not be hardcoded. It will simply check the address in the URL to find the path of the file. In your database, you will have a "fileLoc" field, which will be the exact name of the file. For instance, your DB will look like this: ID - 20, ParentID - 2, fileLoc - thirdLevelPage.asp, Name - Third Level Page Name You would then user the ServerVariables feature to grab the path of the page currently being viewed. It would all be dynamic from the DB, you would just have to copy a template to the folder when the user created the page. |
|
#6
|
|||
|
|||
|
Quote:
This is very interesting. So when the user comes to add a new page, then in effect you are creating a new page. Would you be able to provide me with an example. I appreciate this will take time. But If I can do it this way, and get it working I will be happy to sort you out money wise. As I have spent ages trying to figure out this navigation as you are already aware of. So this would be a new approach for me, and if it works then super. Let me know what you think. |
|
#7
|
|||
|
|||
|
Moved because of the topic title, which is inappropriate for the asp forum.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#8
|
||||
|
||||
|
If you're interested, I think I have amended your existing navigation function to make it work.
Your problem was that you were trying to expand a multiple tier structure with a single ID. So once you had the first expansion to show your sub menus, when you clicked on the link, this initial ID was lost, so the menu would not expand. You needed to incorporate a further ID setting in your bottom tier links to ensure the level above it expanded. Not sure what effect this will have on your CMS. Hope that makes sense.
__________________
Policy Check I'd rather have a full bottle in front of me, than a full frontal lobotomy...
|
|
#9
|
|||
|
|||
|
Quote:
Hey richyrich, could you show me an example of what you have done, or suggesting. So I may see it running with the database. all my cms does is add a new record id. Should be the same. Cheers Trev PS Your not suggesting this approach are you? index.asp?id=1&cid=6 |
|
#10
|
||||
|
||||
|
Quote:
To check what menu to show, you compare this with an ID value in your database. Fine so far. Then your menu sub elements also use request.querystring("pid"), so the initial check of which menu to show by comparing with an ID value from the db fails, hence why your sub menu elements don't appear when you click on a link. For instance, one of the menus uses pid=19. This shows the respective sub menu elements. When you click on one of these elements, your pid=27. So the comparison of pid to the oRS("ID") then fails. The only way of maintaining this menu is to tell it what you originally selected. Hope that waffle makes sense somewhere along the lines! ![]() |
|
#11
|
|||
|
|||
|
Quote:
Mmm this is not really a good approach using this method i.e index.asp?pid=5&cid=8. Ok for a content management system perhaps but for a website its a little poor. If I were to create the pages on the fly would this be better. I.E when the user adds a new page, instead of it being an id as such make it so a new page is added and named whatever the client requires, example: meet_the_team.asp so rather an id just being added, and id and a page name, along with the location of the page. I am not entirely sure how best content management systems are put together, I have done it without actually being tought the best approaches. So maybe I have been doing things incorrectly from the start. Any insight into your thoughts? Thanks for your time. |
|
#12
|
||||
|