SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  2. #2
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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..

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  5. #5
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •