?
Solved

How to create web page hiearchy

Posted on 2005-03-31
5
Medium Priority
?
283 Views
Last Modified: 2010-04-17
Hello,

I want to know how to make a automatic page hiearchy for my web pages...what I want is something like IBM has on their website...When you visit a page, let's say IBM Global Services and then you click on a link for IT Services, on the second page there is now a link "IBM Global Services > IT Services". And as you go farther down, the hiearchy is always there so that you can go back to any point all the way back to the main page. I know this must be a database/programming concept, but wanted to see if anyone knew how to do this.

Thanks
0
Comment
Question by:rgtechsupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 13673507
Usually, for smaller sites, you're better off just manually adding the links, in the HTML code.
However, for large scale sites, you need to use a Server-side script, such as PHP, ASP, JSP, etc..

>> IM
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 1000 total points
ID: 13676150
Hi,

Trying searching 'Google' for "Javascript Breadcrumbs",

e.g.

[ http://www.mickweb.com/javascript/tutorials/breadcrumbs/explanation.html ]

or

[ http://webreference.com/js/scripts/breadcrumbs/ ]

<script language="javascript">

function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a href=\"/\">Home</a> &nbsp;>&nbsp; ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a> &nbsp;>&nbsp; ";
  }
  document.write(output + document.title);
}

</script>


Then call the breadcrumbs() function when you need the hierarchy displaying in your HTML code.

BFN,

fp.
0
 

Author Comment

by:rgtechsupport
ID: 13676416
Thanks a lot, I'll check this out and see how it works!
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 13779827
Hi,,

Is you do not need any further assistance, please could you close the question?

Thanks for your time.

BFN,

fp.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 13786670
Thanks for the points/grading.

BFN,

fp.
[ http://NigelLee.info ]
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question