Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

How to create web page hiearchy

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
rgtechsupport
Asked:
rgtechsupport
  • 3
1 Solution
 
InteractiveMindCommented:
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
 
[ fanpages ]IT Services ConsultantCommented:
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
 
rgtechsupportAuthor Commented:
Thanks a lot, I'll check this out and see how it works!
0
 
[ fanpages ]IT Services ConsultantCommented:
Hi,,

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

Thanks for your time.

BFN,

fp.
0
 
[ fanpages ]IT Services ConsultantCommented:
Thanks for the points/grading.

BFN,

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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now