Default PDF Filenames by Type?
JaredAM - February 19, 2009 - 23:10
| Project: | Printer, e-mail and PDF versions |
| Version: | 5.x-4.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
Description
João,
I was wondering if it might be possible to have a default pdf filename based on type. It didn't look like there was a way to hook into print_pdf_controller from the outside to do this so I thought I'd run it by you.

#1
Hi,
Install the token module, and you'll be able to use some tokens to generate the PDF filename. I should document it more :)
Let me know if that helps you..
João
#2
No, I think you've documented that fine, what I was trying to get at was the ability to set multiple filenames + tokens (for each content type).
For example:
Filename for type Page: [title] - [date]
Filename for type MyCCKType: [title] - [location_city][location_province]
Filename for type MyCCKType2: [title] - [field_mycustomfieldtype]
etc.
#3
No, this hasn't been done yet.. And it's so specific, that I don't think most users would find it so useful to 'burden' their type-specific configuration with this sort of thing.
I guess I could add a themeable function so that advanced users could write their own PHP code to come up with whatever they wanted, though..
João
#4
Sure, however you think might be best.
I was simply thinking of something along the lines of what the path auto module does. A simple foreach to get each type and then just store different patterns for each type. That way it's not pushed out to the content types, but is internal to the print module.
Finally got dompdf working for my project, thanks for the great module.