WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

OT: From the "couldn't care less" department.

Posts

OT: From the "couldn't care less" department.

#1

OT: From the "couldn't care less" department.

Rod Peterson -- Ormond Beach

>Having discovered the magic formula I've been looking for these last eight or nine years which will allow me to set the footer in my webpages from a single file, thus avoiding the necessity of editing hundreds of files to make a single change in the footer in the future (such as I had to do when I changed my link buttons to clever CSS code last year), I am nearing the point where I'll begin a wholesale changeover to the new code. There are, however, two downsides: A) I have to edit hundreds of files to incorporate the code, 2) I have to change every filename to a “.shtml” suffix in order for it to work.

“How does this seemingly insignificant housekeeping trivia affect me?” you might say. Because if you have any pages on my site bookmarked (he vainly postulated), such as the Norm's Tools area (ah, that makes a little more sense), sometime in the next few weeks, it's likely to be disabled. A simple solution, once you run across this annoyance, is to simply change the suffix of the file you are requesting from “.htm” (which most of them currently are) to “.shtml”. I may get around to creating redirect pages, but that would necessitate editing hundreds of files…

I apologize for any confusion or inconvenience this may cause.

Rod

Re: OT: From the "couldn't care less" department.

#2

Re: OT: From the "couldn't care less" department.

Dave MacLuskie

>I spend most of my days at the office trying to minimize the amount of work I have to do (now and in the future), so I understand your frustration.

You can do it with Javascript. Use JS to write the HTML for the footer. You can do this with the string method (easier to read, but "uncool", or with the DOM method (harder to read but "better"). I've used both, though not specifically for footers.

Another option is to redesign the site so that all the content pages sit in an iFrame. The main page has header/footer and never changes. The content pages have no footer at all. Just content.

Third option, use a tool that adds the footer for you at publish time. This could be as simple as a find/replace job.

None are silver bullets.

Re: OT: From the "couldn't care less" department.

#3

Re: OT: From the "couldn't care less" department.

Rod Peterson -- Ormond Beach

>I already have the methodology so far as the code is concerned—it's just a matter of gettting that code into 500+ files.

Dan Donaldson told me about an editor he uses that will do global edits in a bunch of files (each of which has identical code, such as that I'm already using). I'll have to inquire of him what he's using.

Thanks.

Rod

Re: OT: From the "couldn't care less" department.

#4

Syn is what your looking for...  *LINK*

RobV

>


http://syn.sourceforge.net/

Re: OT: From the "couldn't care less" department.

#5

Re: OT: From the "couldn't care less" department.

Don Henthorn

>OK. Where does this shtml thing fit into the current mish-mash? Is it xhtml, html, 4.01 strict, css, ??????? I haven't seen that before.

Re: OT: From the "couldn't care less" department.

#6

404 coding

Mark Goodall - ATL - tooljunkie

>Believe it or not, when a site operator makes wholesale changes like that, you're right, old links fail and even worse, Search engines will point to those missing files.

One solution is creating a 404 error page, which is you basically telling the server, isntead of issuing a 404 page nto found error message, give the surfer an nicely formatted and customer page, where you can say something willty like: "sorry, the page you are looking for has run away. We're still trying to find it. IF yuo happen to find a webpage anywhere, please let me know. Until then, you might want to click here to my home page and perhaps you'll find the page somewhere there".

Happy Woodworking!

Re: OT: From the "couldn't care less" department.

#7

SHTML

Mark Goodall - ATL - tooljunkie

>HTML is Hyper Text Markup Language.

SHTML is a really crappy car.

Seriously though.

A webserver will "serve" up a HTML file to a websurfer just as it is. The server will pull the mypage.html file off it's harddrive and send it to the requestor (the websurfer's browser) just as it is.

A file that ends with .shtml is like a file that ends with .asp or .php. The web server knows that it needs to do SOMETHING ADDITIONAL to that file before it sends it to the surfer. In the case of a .shtml file, the server knows that somehere inbedded in the .shtml is a special instruction telling the server to "include" a second file, along with this one, when it sends the file to the browser.

Happy Woodworking!

Re: OT: From the "couldn't care less" department.

#8

You bet, but wait....

Mark Goodall - ATL - tooljunkie

>Just a thought. Since we were talking about 90's coding, I'd want to to check the use of .SHTML before I made changes to 500 files. Servers obviously still support .SHTML files, but since I haven't used that coding in 8 years, perhaps it's on it's way out.

More importantly.... If you stick with PHP coding, you'll find that this week you change 500+ files to end with .SHTML and then in 4 weeks you'll realize you should have chanced them all to .PHP and you'll be changing those 500 files all over again.

PHP has it's own include feature and PHP isn't going away anytime soon. I'd change them all to .PHP if I were you.

As far as wholesale changes to 500+ files, I use Dreamweaver which included a sitewide "replace" feature. But there are tons of probrams that let you replace "this" with "that" in all the files in a folder. Since I use Dreamweaver, I don't know which is the best, but I know that if you go to download.com you'll find a hundred or so utilities that do mass updates like that.

Also, I wrote some software years ago, that I still use, thqt let's me do mass changes on file names, allowing me to change the extension on 500+ files in about 10 seconds. Utilities at download.com must be avaiable for that too, btu I've been using my software for that for a long time, so I don't know what's available now.

Hope this helps.

Happy Woodworking!

Re: OT: From the "couldn't care less" department.

#9

For the insanely perfectionistic sadist....

Mark Goodall - ATL - tooljunkie

>One a couple of occasions, while overhauling a client's website, I discovered that search engines had a couple of old and important pages that were renamed. So in addition to the "general" 404 page handling, I created a set of extra pages that simply referred the surfer to the correct new page.

For example, a page that used to be all-about-me.html was changed to all-about-me.php, and Google really liked the all-about-me.html page, so I coded a new all-about-me.html page that simply linked/forwarded the surfer to the new all-about-me.php page.

You certainyl wouldn't want to do that to all 500 of your pages, ebcause your 500 page site would become a 1000 page site, but for a few pages, it's an acceptable way to not loose visitors. And the 404 error handling page takes care of any others that may crop up.

Happy Woodworking!

Re: OT: From the "couldn't care less" department.

#10

Thanks, Mark

Don Henthorn

>BTW. My old web site is up, at http://donhenthorn.com View the source code for most of those pages and you will tear your hair out or die laughing. I have cleaned some of it up, but have an awful long way to go. Down with Netscape composer!!!!

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.