Hi,
Our magazine site is using different input formats (Markdown, Media Wiki, etc).
It would help tremendously to have the print module being able to display a page in its native format as well, without trying to render it as html, so that users could see (or download) the content of a page in its own native format.
Right now the format available are: html, mail or pdf. We would need to have something like a "native" format available, so that using something like:
domain.com/print/page/export/native/3
would just dump the content of $node->body of nid 3, whatever input format may be used there.
We could just add our own custom page, but having this feature built-in the print module would make it more natural and much more elegant. I am sure many users would also appreciate this.
Thank you
Comments
Comment #1
jcnventuraHi,
The "native" format would always be HTML (or XHTML or plain text, it doesn't matter because the browser will always use its HTML rendering anyway).
So in that sense, the native format is already supported. If what you want is to remove all the 'extra' stuff that the module inserts in the page, just edit the print.tpl.php file and delete all lines except for the print['content'].
João
Comment #2
sam6 commentedThank you for the quick reply.
It is actually possible to have the browser display the content as text (not rendering the stream as html), using the php header() function.
Since $node->body holds a node's native body, but pre-rendered, one can access directly the SQL field (I know, it uses lots of queries).
Editing print.tpl.php to this:
does exactly what I meant.
The problem is of course that it is ugly and all the main features of the print module are gone.
Would there be any chance in the future to have a new "plain" format available to the print module, so that one could enable the behaviour of the snippet above?
I think many webmasters would find it a useful addition.
Thank you so much for the help, and your wonderful module.
Comment #3
jcnventuraI don't think that this would be of much help to anyone..
Anyone programming in Drupal already has access to all those features.. What you're really asking seems to be some kind of Web Services API, and for that I would look into the Services module.
João