Programmers for Hire
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgrammers for Hire

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 23rd, 2007, 03:40 AM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
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.
Attached Files
File Type: zip navigation.zip (18.4 KB, 70 views)

Reply With Quote
  #2  
Old April 23rd, 2007, 01:16 PM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
Come on guys, how about £40. Cannot go any higher!

Surely someone knows how to do this???????????????

Reply With Quote
  #3  
Old April 23rd, 2007, 01:20 PM
BLarche BLarche is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Indianapolis, USA
Posts: 3,388 BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 21 h 33 m 41 sec
Reputation Power: 601
Quote:
Originally Posted by trevorsaint
Surely someone knows how to do this???????????????



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.

Reply With Quote
  #4  
Old April 23rd, 2007, 01:29 PM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
Quote:
Originally Posted by BLarche
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.


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

Reply With Quote
  #5  
Old April 23rd, 2007, 01:39 PM
BLarche BLarche is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Indianapolis, USA
Posts: 3,388 BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level)BLarche User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 21 h 33 m 41 sec
Reputation Power: 601
Quote:
Originally Posted by trevorsaint
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


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.

Reply With Quote
  #6  
Old April 23rd, 2007, 01:54 PM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
Quote:
Originally Posted by BLarche
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.


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.

Reply With Quote
  #7  
Old April 23rd, 2007, 01:59 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
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

Reply With Quote
  #8  
Old April 23rd, 2007, 02:04 PM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,193 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week 1 Day 21 h 5 m 16 sec
Reputation Power: 1227
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...

Reply With Quote
  #9  
Old April 23rd, 2007, 02:10 PM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
Quote:
Originally Posted by richyrich
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.


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

Reply With Quote
  #10  
Old April 23rd, 2007, 02:20 PM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,193 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week 1 Day 21 h 5 m 16 sec
Reputation Power: 1227
Quote:
Originally Posted by trevorsaint
Your not suggesting this approach are you?
index.asp?id=1&cid=6
Yes. If you look at your navigation sub, you're using the request.querystring("pid") value initially to expand the menu structure.

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!

Reply With Quote
  #11  
Old April 23rd, 2007, 02:27 PM
trevorsaint trevorsaint is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2004
Posts: 594 trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level)trevorsaint User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 21 h 24 m 17 sec
Reputation Power: 10
Quote:
Originally Posted by richyrich
Yes. If you look at your navigation sub, you're using the request.querystring("pid") value initially to expand the menu structure.

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!



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.

Reply With Quote
  #12  
Old April 23rd, 2007, 02:46 PM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,193 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127768 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week