• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Can HTML do this?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

JohnnyTheRed

Member
Joined
Aug 9, 2002
Location
Brockton MA
Hey gang, hoping you could help me out.

I'm creating a help file. That's the easy part. I'll tell you what I'd like to do and perhaps you could help me out. The help file will reference people and their positions within the department I work for. However, sometimes positions are referenced dozens or hundreds of times in this help file. I would like to make it so that when those positions are vacated and then filled with another person I don't have to go through the help file and update those dozen or hundreds of listings. I'd like it so that somehow I can create a file or table that has a list of positions and the person that occupies it. And the help file references that file or table. That way I only have to update the file or table and the help file updates all the references to that position itself.

Hope I'm making sense.

Thanks in advance for your time and information!
 
There is 2 ways of doing this that I would suggest.

One, no, HTML cannot do this alone so you might have to use a scripting language to parse the file in order to display it dynamically on the help screen for your users. HTML is only a markup language meaning it is only shorthand for making a browser display content.

Two would be to use a XML file and an XSLT file to convert the XML to display in a user friendly format. This way you could edit the XML file and the XSLT file will automatically convert it for you so the browser can display it. This would require IIS if I remember correctly where the first option above would allow for any scripting language of your choice. This would be for a more advanced programmer and is really superseded by ASP.NET and the ability to code in the backend to an XML file with the extension .aspx.

I would suggest looking up Visual Studio Web Developer Express, PHP, or even the older CGI languages. I cannot remember but I think Javascript is limited to the browsers interface (Sandbox) and cannot interact with the file system to read a file or even a database.

If someone can think of what I couldn't, please speak up! :)

Taco
 
Yea, HTML can't do it alone. Sounds like something you'd be able to do rather effectively in PHP and a MySQL database to hold all your table data. I'm still learning PHP (put it on the backburner for the moment to focus on ActionScript 3.0), but it's definitely doable... I'm just not the guy to tell you how to code it from scratch yet. LOL
 
This is easily doable in php and mysql. Make a database table called positions or some such. Each entry has two fields a name and a position. Enter the name and position of each person into the database. Then create your help file with php. You can do database calls to select the particular position or you can just grab the whole thing and display it all at once.

good luck.
 
I'd use PHP to do that. It would require only basic knowledge of PHP to make the substitutions on the fly.
 
I have not been exposed to PHP yet since I am a Microsoft Shop but all I know about it iswhat I read in message boards like this one. I recommended it here because of the popularity of it on these boards.

The question I have is what is the allure of PHP? Does it have more pros then cons to other scripting/programming languages for the web?
 
Well, from what I understand, it's fairly easy to pick up. I've taught myself some of the basics w/ very very little programming knowlege or experience previously (basic JavaScript, and a little bit of ActionScript 1.0 is about the extent of my knowlege). They're also ideally run on an Apache server. Apache is pretty well known for its reliability... that and the fact that PHP and MySQL are both free. Also, they're both very heavily used by the Open Source community. I'd imagine that helps drive the popularity a bit too. ;)
 
you don't even need MySQL, if you don't want to do that. PHP can parse text files to grab the info, if you would rather go that route. I always use MySQL as the backend, but I have seen people use txt files before.

you might be able to use Python, also, but I have never done anything in python.
 
Hmm, instead of coding your own stuff, why not use some free stuff thats already out there? What about making a business wiki? Everytime the position is referenced its linked to the page describing the position(which would have the person who holds it) and if they leave or whatever you can just edit the positions article, right?
Plus, having a wiki is so "in" these days.
 
Professional advice costs 29.99 payable to me.

Well, it's not clear what platform his using to do this on, but...

There is a method far simpler than any suggested in that thread. This could be achieved via some clever CSS tricks, if whatever is displaying his help file is truly HTML based.

He would need to make a CSS class up for every position and put it in a .css document, for example:

.newscaster

Then, he would need to use the ":after" pseudo-class, and the content attribute, like so:

.newscaster:after {
content: 'Ron Burgundy';
}

Then, in his HTML, he would assign that position CSS class wherever he would want the name to appear:

<p>Tonight's broadcast will be presented by San Diego's own, <span class="newscaster"></span>!</p>

THEN, within the <head> tags of every HTML help page, he would include this tag to link to the .css file:

<link href="positions.css" type="text/css" rel="stylesheet" />

So, it would universally grab the name of whoever holds the position of Newscaster from "positions.css". After that, if you change the name in the positions.css file, it will change on every page where the "newscaster" CSS class is used.


The only hitch here is that Internet Explorer doesn't give a damn about the ":after" pseudo-class, or any pseudo-class outside of hover. The upshot is it requires virtually minimal setup, no database or programming whatsoever, and would probably only take a half-hour to complete. If I happen across a fix for this, I'll pass it along.
 
you don't even need MySQL, if you don't want to do that. PHP can parse text files to grab the info, if you would rather go that route. I always use MySQL as the backend, but I have seen people use txt files before.

you might be able to use Python, also, but I have never done anything in python.

Absolutely.

I wrote a simple XMLish (ish because it's not true XML 1.0) parser to manage data like this:

http://cristinilab.shis.uth.tmc.edu/Publications_Cancer_Nanotechnology.xml

And put it into usable forms like this:

http://biomathematics.shis.uth.tmc.edu/Publications.php (no forms)
and
http://cristinilab.shis.uth.tmc.edu/Publications.php (with forms)

Once you can start parsing text files using PHP, you can do all sorts of useful things, like make news pages (e.g., http://biomathematics.shis.uth.tmc.edu/news.php) and RSS feeds (see both sites), since it's a matter of entering your news into a "database" (a formatted text file) and parsing it according to need.

IIRC, PHP has some built-in XML capabilities, but I haven't taken the time to learn them. -- Paul
 
Tyranos, that sounds like the best and easiest way (at least for me) to go about doing this project. I tested it out briefly and it seems to do exactly what I want. It's exactly what I want... one file with a listing of all the positions and the names of the people assigned to those positions. Every web page I make will reference that file. Everytime the people in those positions change I will only have to update that one file and recompile the Help (.chm) file, and every reference to that position will automatically be updated.

Thanks so much, to everyone, but to Tyranos especially, for your suggestions. Perhaps with more time I would have tried learning PHP or MYSQL as I'm sure those have much more uses. But this is the best way for me at the moment (as far as I can tell).

Thanks again!
 
You could use "<a name="director_of_department">" and then "<a href="page.html#director_of_department">Director of Department</a> to make links back to which is the director of the department, or whatever position ou want
 
another html question, not trying to thread jack, but...it sounds like your question has been answered so here is mine, i looking for something really easy, i see it all the time on other websites, its kinda like a drop down box option, but without the box, says it says..

processors, then there is a + sign, click the + sign and it will show intel / amd in the expanded list. is there any easy way to do that ? i know its a simple code.
 
kinda like what this guy has on the left side of his page....


myorderform.gif


i guess it will have to be done in frames ? if ppl still sue those, then that way you can still have it open, and you click whatever link you want and it opens that page on the side.
 
you can do that with Javascript or DHTML, or both. I think you'd want to search for "cascading menu"
 
i guess it will have to be done in frames ?

Nothing ever *has* to be done in frames. IMO, there's no good reason to ever use frames. :p

And yes, that menu wouldn't be too hard to do. Like Splat said, do some searching around for cascading menus. Dynamic Drive might be a good place to start looking.
 
Ok, so i found the type of menu I will be using, how to I go about.... NOT using frames ?
 
Back