RE: printer-friendly template questions
"George Myers" <[email protected]>
| Newsgroups | gmane.comp.cms.jahia.template |
|---|---|
| Message-ID | <[email protected]> |
Well after rolling up my sleeves I quickly discovered the solution was close
at hand and essentially trivial.
Perhaps this will help someone else:
1. Version 405 (not sure about earlier) has "thePrint" in
..include/declarations.inc initialized from a url parameter.
Any jahia url such as http://localhost:8080/jahia/Jahia?print=1 will
render without the header, footer, and side
navigation - this is essentially what I wanted.
2. Giving the use a clickable link is as simple as putting
<a href="javascript:printfriendly();">print </a> in header.inc and in the
same file putting
" function printfriendly() { window.location.href=window.location.href
+ "?print=1"; } "
Using a function will make it easier to manage opening a new window.
-----Original Message-----
From: George Myers [mailto:[email protected]]
Sent: Tuesday, April 26, 2005 4:18 PM
To: [email protected]
Subject: RE: printer-friendly template questions
Thanks for your suggestions Greg!
I have been having thoughts along these lines and certainly expect to create
specialized css for this.
I still have a faint hope that a jahia template expert has gone thru this -
at least the printer part - and can supply an optimized template or fragment
there-of that implements this feature (not the css).
... I don't think this violates the mailing list policy (apologies if I'm
wrong!) but recognizing that
time - even mine - is money I'm willing to purchase this experience, within
reason. I would be happy
to be contacted directly about this to discuss T&Cs.
regards
George.
-----Original Message-----
From: Greg Kerdemelidis [mailto:[email protected]]
Sent: Tuesday, April 26, 2005 3:50 PM
To: [email protected]
Subject: RE: printer-friendly template questions
Hi George,
Just a couple of suggestions here:
1) The trick here would be to have a media=print css file, while is included
in all the pages. You would have to look through the web layout and produce
appropriate printer versions of the tags/id's. Things like stripping out the
menu + header, hiding the footer, etc. Have a google around for more
information about this. It's possibly not what you're looking for, but it
does give your users the ability to produce good-looking ad-hoc prints from
the site. We have used this approach successfully a few times in the past.
2) You could implement this by having the page link encode the current URL
and pass it as a parameter to another template / servlet:
Eg, for a page /jahia/Jahia/pid/123, produce a link looking something
like:
/Jahia/Jahia/sendtofriend?url=/jahia/Jahia/pid/123
The sendtofriend template would use the RequestDispatcher to dispatch the
request internally to /jahia/Jahia/pid/123, collect the result in a
StreamBuffer (or whatever), and send that to the recipient. Oh, you'd need a
page with the target email address form first, but you get my drift...
Sound about right?
Regards,
Greg Kerdemelidis
Senior Java Developer
MSO New York -- A Diligent Company
Christchurch, New Zealand
-----Original Message-----
From: George Myers [mailto:[email protected]]
Sent: Tuesday, 19 April 2005 9:44 a.m.
To: [email protected]
Subject: printer-friendly template questions
I have two related questions.
1. I want to create a printer-friendly view of any page of site content.
The latest documentation has nothing on this yet
- but has an empty section showing that this is planned.
Can a Jahia team member please post a pre-release version of that
information to
advise on how best to do this. I am sure this has been done by
other Jahia users and I really don't want to
re-invent this, so I would very much appreciate some sample template
code.
2. I want to create a feature to "send this page to a friend"
- the contents in printer-friendly format, not just the URL -
to a specified email address. Same points as above.
Any help would be greatly appreciated.
thanks,
George.