How-To add automatically the title of the page in the PDF?
Permalink Browser Info Environment
Is there a way to do that?
Thanks in advance.
Thanks in advance.
Type: | Discussion |
---|---|
Status: | New |
Yes I mean what you said at the last instance.
Quick, easy dirty way that might work for ya - keeping in mind the following:
Since I haven't tested this and haven't built any customization, I don't want to add this to the production package - but I can walk you through how to add it yourself if you're comfortable making a change to the code on your installed server.
When I do release the next update it will overwrite these changes if you update, and I still may not have a customization option for this once it happens, meaning you'd need to do it again after the update.
Those things being said, if you know how to "get to" your installation folder for concrete5. If you are able to do that it's very easy: open the following file:
/packages/trans_marine_save_area_to_pdf/blocks/save_area_to_pdf/controller.php
On line 62, you'll find:
$htmlToSave = ob_get_clean();
change that to:
$htmlToSave = $c->getCollectionName().ob_get_clean();
save the file. Note there is a period '.' between getCollectionName() and ob_get_clean
Save that, and the name of the page will end up as the first line of the output PDF the next time you click the block. I tried this myself, but again YMMV. Good luck -J
When I've got some down time I'll be revisiting this project and adding other enhancements.
Since I haven't tested this and haven't built any customization, I don't want to add this to the production package - but I can walk you through how to add it yourself if you're comfortable making a change to the code on your installed server.
When I do release the next update it will overwrite these changes if you update, and I still may not have a customization option for this once it happens, meaning you'd need to do it again after the update.
Those things being said, if you know how to "get to" your installation folder for concrete5. If you are able to do that it's very easy: open the following file:
/packages/trans_marine_save_area_to_pdf/blocks/save_area_to_pdf/controller.php
On line 62, you'll find:
$htmlToSave = ob_get_clean();
change that to:
$htmlToSave = $c->getCollectionName().ob_get_clean();
save the file. Note there is a period '.' between getCollectionName() and ob_get_clean
Save that, and the name of the page will end up as the first line of the output PDF the next time you click the block. I tried this myself, but again YMMV. Good luck -J
When I've got some down time I'll be revisiting this project and adding other enhancements.
Thanks a lot. I will try it and give you a feedback.
Do you mean as content? (say, as the first line in the outputted PDF) If that's what you mean let me know and I'll see what I can do! -J