mittwald / typo3-web2pdf

A TYPO3 extension for rendering content as PDF
GNU General Public License v2.0
18 stars 20 forks source link

Does not work with tx_news - ignores parameter #69

Closed gg-philipp-duell closed 7 years ago

gg-philipp-duell commented 7 years ago

Usign Web2Pdf to print News from tx_news as PDF does not work properly. Web2Pdf ignores the tx_news parameters and always prints the first news that is shown on a news-detail-page wether another news is shown currently or not.

E.g. the url of a news currently shown would be: index.php?id=454&no_cache=1&tx_news_pi1%5Bnews%5D=709&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&cHash=bebd70f5b440c4b835684ff68f6a4711

Web2Pdf will generate a URL to download the pdf without the single-news-id: index.php?id=454&no_cache=1&tx_web2pdf_pi1%5Bargument%5D=printPage&tx_web2pdf_pi1%5Baction%5D=&tx_web2pdf_pi1%5Bcontroller%5D=Pdf&cHash=1005da9f4ac26995f4c4ce69c7900b58

Where can i force web2pdf to use all parameters?

gg-philipp-duell commented 7 years ago

Seems to be a problem when using cooluri.

TYPO3 7.6.12 web2pdf 1.1.5 cooluri 1.1.3

gg-philipp-duell commented 7 years ago

Okay - Using: `

tx_news_pi1[news] SELECT path_segment,title FROM tx_news_domain_model_news WHERE uid=$1 AND sys_language_uid >= 0 1

` in the CoolUriConf.xml will prohibit web2pdf from generating the correct link to the pdf. As soon as this rewriting is removed the pdf of any single news-item works. But - the URLs get nasty.

Any ideas on that?

r4fx commented 7 years ago

In /Templates/Pdf/GeneratePdfLink.html to f:link.action add one additional attribute : addQueryStringMethod="GET". This will keep query string from news detail.

And then in CoolUri configuration CoolUriConf.xml add

to <uriparts>

<part>
   <parameter>tx_web2pdf_pi1[argument]</parameter>
   <t3conv>1</t3conv>
</part>

to <predefinedparts>

<part>
    <parameter>tx_web2pdf_pi1[controller]</parameter>
</part>

<part>
    <parameter>tx_web2pdf_pi1[action]</parameter>
</part>
gg-philipp-duell commented 7 years ago

Great! That works! Thanks a lot.