I have a question..
I am trying to Dynamically create a trace bar or some people call them "Breadcrumbs". Does anyone know of an Applet or a JavaScript that can create them Dynamically?
Printable View
I have a question..
I am trying to Dynamically create a trace bar or some people call them "Breadcrumbs". Does anyone know of an Applet or a JavaScript that can create them Dynamically?
Nope!
I can't picture what you mean. Can you explain further please?
Mark, Cheers for having a look :) , how are you? here is a description of what I am trying to do:
What I am trying to do is the following (see picture) basically it tells you where you have been so that (stupid) users don't get lost in the site...Also means that the (stupid) users can get back to the home page!
I would like this to be dynamic so that there is as little coding as possible (Maybe a Jave Applet or something like that).
a bit like where is says:
VB Q and A > Other Languages > XML, HTML, Javascript, Web and CGI > Trace Bar Question
at the top of this page?
Is that the sort of thing you want?
Yep. It needs to be Dynamic so it checks all the site and knows (if you get my drift).. I know it's a big ask.... But I am sure that it is possible. Any ideas?Quote:
Originally posted by Mark Sreeves
a bit like where is says:
VB Q and A > Other Languages > XML, HTML, Javascript, Web and CGI > Trace Bar Question
at the top of this page?
Is that the sort of thing you want?
Is this getting close to what you want?
paste this into each file
Code:<script language=Javascript src="/loc.js">
</script>
paste into a file called loc.js located on the webroot
Code:
var loc = '' + window.location;
var arrLoc = loc.split('/');
var strOut ='';
var strOutB = '';
for (var i=0; i< arrLoc.length; i++)
{
strOut += arrLoc[i] + '/'
strOutB +='<a href="' + strOut + '">' + arrLoc[i]+'/' + '</a>'
}
document.write(strOutB)
Cheers Mark I will check it and get back to you! :D
Sorry mate not quite what we were after... I have got someone here to write a better description of what we want... Cheers anyway... The way that I see what we want is exactly like the trail that appears on the top of the VB forum saying which Forum you are in anf ultimately which thread.. We want to be able to do the same, but the problem is making it dynamic and so that it knows where all pages go.......
It seems to me that it might not be possible... I will post the description later. :)
I've done it now so I may as well post it...
Code:
var loc = '' + window.location;
var arrLoc = loc.split('/');
var strOut ='';
var strOutB = '';
for (var i=0; i < arrLoc.length; i++)
{
strOut += arrLoc[i] + '/'
if(i>1){
strOutB +='<a href="' + strOut + '"><b> ' + arrLoc[i] + '</b></a><b> > </b>'
}
}
strOutB = strOutB.substring(0,strOutB.length -6)
document.write("<small>")
document.write(strOutB)
document.write("</small><BR>")
Thanks for the script, it was a nice script! :) . Here is what we are after - better description :
-----------------------------------------------------------------
All of our pages reside at the root level. The trace bar should indicate the links you have to go through, before you reach your detination page from the home page. It should be based on page titles. The Hierachy of the site should not effect the trace bar only the way the pages are linked together should be the data source for the trace bar.
Basically alot like the VB Forums one above.... but we don't want to hard code the trace bar in each page, we want it to creat itself dynamically.
---------------------------------------------------------------
Sorry to waste your time Mark with your other scripts. that was from my colleague.... Cheers for all your help Mark. :D
Cheers Mark,
I will try that out today... I'm sorry that this one is so damn hard. But I feel that if this is worked out then it could be useful for many other people too... :)
I will get back to you. :) :D
I'VE DONE IT!!!!
It works a treat!!!!!!!
I'm a bit reluctant to make the code avaiable to everyone though.
email me if you want it.
I can get on with some proper work now! ;)
Does it work ok on Windows IE? Thats what we use on our Intranet and we would prefer it not to crash it.... Well done though... I will email you for the code.... Thanks for all your help mate!!! :)
A little late, but this link might be very usefull to you.
http://www.4guysfromrolla.com/webtech/110498-2.shtml
Hope it helps.
Mark,Quote:
Originally posted by Mark Sreeves
thanks for the link hellswraith
but...
I'm not getting at anyone here...
when I reply to a post I try to take into account what question is being asked.
Yes it would be p i s s easy using Active Server Pages but the original question was:
Cheers for the Email... my coder says that he will use the serverside solution that you suggested. He was just hoping that it was possible to do it in a different way.... I guess he wanted too much! :)
Thanks again Mark, you are a life saver! :)
Hey Mark, thanks for the criticism, I enjoyed it. Sometimes people ask questions, and they may not know exactly what they are asking for. I just offered up another way to do it. Sometimes when I ask a question, people respond with things that I thought I shouldn't use, but instead they opened my eyes to why I should or another way to approach a problem I hadn't thought about.
Despite what your post says, you ARE trying to get at me. My post may not have helped Chris, but it may have led another person to an answer, and since the topic is related, I find no error in that.
Have a nice day everyone. ;)
I agree with you hellswraith. I find that any solution is MUCH better than no solution. And, if people had not suggested alternate ways to help me accomlish something, i probably would not know about half of the stuff that i do!
Thank you to everyone... Hellswrath, your assistance was useful and has been used in a different site with a different use. Unfortunately couldn't be used in the site we are currently making... The site we are curently making has now got working trail bars thanks to the code from Mark... cheers to both of you. :p