Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Printer Friendly version?

(Page 1 of 2)
> >
Quote Reply
Printer Friendly version?
I would like to create a template set that is a printer friendly version of an article (link) and I am just looking for what I would use to call the page. So, it would only be for the detailed page. What would I use to call the DB for that page alone. In other words, I don't want folks being able to surf our entire site dynamically (server load issues). Is trhere a way to have a static printer friendly version display?

How would I do this?
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Sure...build a copy of all your detailed pages.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Don't the copies just replace the originals? I can imagine changing the setup paths, but this is a bit much for my staff of non-techie editors to do and reset when they are done. Too many steps. I'd rather hav it set up in the templates or a global or something, so that it just works right.

Other ideas?
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Uh...NOT if you use a separate detailed build subtroutine in the nph-build.cgi script!!!!!!!!!!!!! Tongue

Uh, if you copy the detailed sub, name it something else, then edit the variables in that sub to a "copy" name of the detailed pages, then you would have the following type of files in your "Detailed" folder:

1.shtml
print1.shtml
2.shtml
print2.shtml

Got it? Good!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
You could do that in a plugin.

1) Create a PRE hook on 'create_detailed' and let it run your function 'build_pf_detailed'.
2) Then you would basically just copy the sub '_build_detailed' into your function 'build_pf_detailed'. You would have to change the name of the output files (into something like '423_pf.html' (where 423 is an example link ID). And you would have to change the name of the template file to use.
3) make a new template file for the printer-friendly detailed pages.
4) link to the files in the appropriate places.
5) build your directory.

Voila. It's really not that difficult.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
Hey Yogi,

Thank. I don't know how to create a PRE hook. Is there some documentation somewhere that would explain this? Or can you explain this? Thanks again.

Last edited by:

Evoir: Apr 5, 2002, 1:56 PM
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Hi,

I have attached a plugin that should do the job. I've kept it very simple. What you have to do is the following:

1) Install plugin (called SecondDetailed, see attachement)
2) create a template called "detailed2.html" (this is the printer-friendly template)
3) build your directory. The usual detailed pages are under /Detailed/1243.html, the printerfriendly ones will be under /Detailed/1234-2.html

Hope it works. I thought that this would be a quick thingy, but ended up coding for an hour before it was actually working....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Have you considered doing this with CSS? This is our solution for printers ... though it does not work on old browsers, so is not a universal solution. Try it if you don't require printer-friendliness for every single visitor ...

On each page, link to two stylesheets, eg:
Code:
<LINK REL="stylesheet" HREF="/print.css" TYPE="text/css" MEDIA="print" TITLE="Print">
<LINK REL="stylesheet" HREF="/screen.css" TYPE="text/css" MEDIA="screen" TITLE="Screen">

File screen.css contains the normal styles; print.css contains only simplified styles with no positioning, font families, font sizes, etc.

Menu systems and other page clutter can be hidden from the printer like this ...
Code:
.barmenu, .search, .footnotes, .breadcrumb {
display: none;
}
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
Wow yogi, you rock! I'm gonna get to this in the next few days. Thank you very much. I hope others will benefit from the work you put into it. Smile
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
Yogi,

I installed the plugin, and created a second detailed template called detailed2.html

When I went to build all" I get the following error:
Code:
A fatal error has occured:


Can't locate object method "get_plugin_user_cfg" via package "Links::Plugins" at /big/dom/xcurvemag/cgi-bin/LSQL/cgi/admin/Plugins/SecondDetailed.pm line 31.

Please enable debugging in setup for more details.

Ideas? Solution?

Thank you!
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
What version of Links SQL are you using?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
LSQL 2.10
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Can you enable debugging and post the details?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
yogi,

I enabled debugging, turned your plugin back on, and tried re-building. Basically, it is stuck... calling the webpage. I guess it would be called a time-out. Ok, the page finally loaded, but it doesn't show the whole build process. It just stops:
Code:
Started at Wed Apr 10 05:01:34 2002.

Creating backup file ...
Done (0.00 s)

Resetting hits and rates ...
Done (0.00 s)

Updating New Flags ...
Done (1.00 s)

Updating Changed Flags ...
Done (0.00 s)

Updating Cool Flags ...
Done (0.00 s)

Building Home Page ...
Done (0.00 s)

Building What's New Index ...
Building Subpage: 2002-03-27 ... 7 links ok.
Building Subpage: 2002-03-28 ...
and doesn't go any further. This is with debugging set to 1


p.s. Yogi, I think you have a really nice LSQL site. Is the consistant left navigation bar a LSQL SSI type thing? Or is that dynamically generated?
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
In Reply To:
I enabled debugging, turned your plugin back on, and tried re-building. Basically, it is stuck... calling the webpage. I guess it would be called a time-out. Ok, the page finally loaded, but it doesn't show the whole build process. It just stops:

Strange. I don't see why it wouldn't work... Is there no error message?

In Reply To:
p.s. Yogi, I think you have a really nice LSQL site. Is the consistant left navigation bar a LSQL SSI type thing? Or is that dynamically generated?

Thanks. At the moment, I am still using Links 2, I am in the process of migrating to LSQL. As far as I know, I only have a left navigation bar on the homepage, not on any other page.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
You need to make sure you have:

use Links::Plugins;

....at the top to be able to use get_plugin_user_cfg

Or change:


my $sdv = Links::Plugins->get_plugin_user_cfg('SecondDetailed');

to

require Links::Plugins;
my $sdv = Links::Plugins->get_plugin_user_cfg('SecondDetailed');

Last edited by:

Paul: Apr 10, 2002, 2:30 AM
Quote Reply
Re: [Paul] Printer Friendly version? In reply to
Yes, that is probably it! I have it locally, but probably forget to put it in the file.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Paul] Printer Friendly version? In reply to
Paul,

I know this sounds lazy or dumb... but can you explain to so a dummy can just follow your directions really simply. (like: find this. replace this. or, between this and this put this line)

I vaguely know what you are talking about, but I can follow directions pretty well. Smile
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
1) Uninstall the plugin
2) click on edit
3) click on edit (SecondDetailed.pm)
4) add the line use Links::Plugins; just under use vars qw/$USE_HTML $TIME_START $GRAND_TOTAL $SECOND/;
5) reinstall the plugin.

Hope that helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
I'll give it a shot. Thanks. I'm heading out of town, so it may take me a week or to. But I'll try and post back here with results. Thanks again!
Post deleted by Evoir In reply to
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
I believe I have it installed successfully. Smile

Now, how do I link to that second detailed page? What do I put in my detailed page to link to second detailed, and what do I put in second detailed to link back to detailed?

I use a static site.

Thanks!
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
If your first detaild page is called 123.html, then the second detailed page will be called 123-2.html. It will reside in the same diretory (probably Detailed/).

So you could put something like
Code:
<a href="/Detailed/<%ID%>-2.html">Printer Friendly Version</a>
for linking to the second detailed page.

For linking back to the first detailed page, you could use
Code:
<a href="/Detailed/<%ID%>.html">Printer Unfriendly Version</a>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Printer Friendly version? In reply to
very helpful. Smile

and so obvious I am embarrassed. Thanks again.

Last edited by:

Evoir: May 12, 2002, 8:24 PM
Quote Reply
Re: [Evoir] Printer Friendly version? In reply to
Hi Everyone,

I installed this pluggin and it works great however it doesn't build the pages when I use BUILD CHANGED or BUILD STAGERED it only works with BUILD ALL. Can you please tell me what changes I have to make in order to get this to build the pages by clicking BUILD CHANGED and BUILD STAGERED ?

Thanks in advance,
PCMANIAK
> >