cooltronicpl / Craft-document-helpers

Craft CMS 3 and 4, 5 plugin enabling PDF document generation from template Twig files, code blocks and URLs
Other
13 stars 6 forks source link

Entry Data not populating in template #2

Closed brandondeweese closed 3 years ago

brandondeweese commented 3 years ago

I can't get any data from simple fields in entry, such as entry.slug, to appear in the generated pdf. But oddly, I'm able to return fields with arrays. Am i missing something here?

    <a href="{{siteUrl}}{{craft.documentHelper.pdf('blog/_pdf.twig', 'file', 'document.pdf', entry, '' )}}" target="_blank">Download

</a>

Screen Shot 2021-09-01 at 7 11 37 AM

cooltronicpl commented 3 years ago

We added a custom field to parse some variables which aren't passed by Craft when you pass from an array-like entry and you have only variables from CMS. Now we can pass in a custom field in attribute an array, number, date, or string. This was described in README on the 0.0.6 version.