Closed parwinderD4D closed 2 years ago
You are using illegal characters in the name of the file.
The characters are not escaped in HTML by Craft templating in the browser URL to file, try using "-" instead of ":".
But I assume to insert date varaibale the best is to insert to filename the Unix timestamp of the created date:
submission.dateCreated|date("U")
or when the date is necessary in filename replace the : by - after hour.
submission.dateCreated|date("Y-m-d-h-s")
Examples:
<a href="{{ alias('@web') }}/{{craft.documentHelper.pdf('_pdf/document.twig', 'file', 'pdf/' ~ submission.dateCreated|date("U") ~ '-' ~ random(100) ~ '.pdf' ,entry, pdfOptions)}}" download>
<a href="{{ alias('@web') }}/{{craft.documentHelper.pdf('_pdf/document.twig', 'file', 'pdf/' ~ submission.dateCreated|date("Y-m-d-h-s") ~ '-' ~ random(100) ~ '.pdf' ,submission, pdfOptions)}}" download>
You can pass now custom variables as described in the readme from the 0.0.6 version.
Hi Team, What I am trying to do we have created certificates based on entry values. I have pass entry into the template twig file as per given into documentation. All the parameters are working fine, even assigned entries as well. But I am getting errors when I try to print the date parameter under the certificate template.
Please have a look at the attached Screen-shots :
dateCreated
variable]dateCreated
variable ]Here is My Code
`
`
Could you please help me to fix this issue?
Looking Forwards Thanks