Some sites have little icons of printers that say "Click here for a more printer friendly version" or "Click here to print this page". When you click on them it brings you to a page striped of most ads and the navigation bar and all non-essential items on the normal page.
How is this done? Do they actually write a second page for every page they have? Isn't that time consuming and somewhat annoying when you have to update two pages every time you just want to change something?
Or is this somehow acheived with server side scripting or the like? :confused:
I would imagine that the content would be stored in a database of some sort and the script page would have a flag to indicate whether or not to display the ads etc..
Also, I would think it'd be possible to do this without a database.. for example, the url could be somepage.php, and the printer friendly page would have the url somepage.php?print=1 .. and within the php script, you would check if the print flag was set before displaying stuff like ads and nav bars.. of course, this would be a lot more painful than just using the database.. :)
Yup, it's server-side, unless they're stupid like me - I actually did it by hand for a short while - thank goodness that didn't last.
Definitly server-side, although, IMHO, it would be easiest to do with a database and two template pages. One template is the default for normal articles and the second is for print articles.
Article ID's are added to the links on the fly, i.e. mysite.com/article.asp?ID=23456 The server requests the article page. The article page has a query that pulls the content associated with the ID. It would also generate a link with a matching ID, i.e. mysite.com/prntarticle.asp?ID=23456. The other page has the same basic structure without graphics.
Your only maintaining two pages. Content is generated from a database which to the ned user seems like an infinite number of pages.
Bummer, the answer is a lot more complicated than I was hoping. Oh well, I guess I'll have to forget that for a while...
Thanx anyways guys, at least now I know in what direction to start looking. :)