Open Aybee opened 3 years ago
Wieso nimmst du nicht auch direkt diese normalen Links, die Erweiterung
contao/tcpdf-bundle
von Leo nimmt die auch, und dann würde es doch funktionieren, oder habe ich da etwas nicht bedacht?
🤷 I implemented this a long time ago and never used this feature myself or in any of our customer's projects. Feel free to create a PR with the correct link ;)
Ok, thank you. I will take a look at how Leo does it in his extension and will come back. Thank you.
ps I also never used this. A customer wants those share buttons and PDF link.
So far I repaired it with JS
// templates/j_patch-share-buttons-pdf.html5 - info@andreasburg.de
jQuery(function($) {
var pdfLinks = $('.sharebuttons .pdf'),
path = window.location.pathname.replace('/', '');
pdfLinks.each(function() {
var articleId = $(this).attr('href').split('=').pop();
$(this).attr('href', path + '?getpdf=' + articleId);
});
});
Fixed in 3dd4402.
Thank you Fritz 👍
Unfortunately, the PDF generation now only works if the option is checked in the article. The customer uses the sharebutton module included in the layout, to show them page wide.
We explicitly tested this with version 2.1.5. That works without checking the option in the article. With 2.1.7 it no longer works. We did not test 2.1.6.
Yeah, this is actually deliberate. Otherwise every page could be printed with the GET parameter, even though it was not enabled. This is not intended nor desirable. I changed it so that PDF printing only works if you enabled it in the article or a share buttons content element. But I think it is feasible to expand the check to a share buttons module included in the page layout.
Hello Fritz, I am the customer of Aybee... yes, thank you very much, that would be great. Otherwise we would have to manually activate all articles in the backend.
grashalm
But I think it is feasible to expand the check to a share buttons module included in the page layout.
👍 Yes, that would be great as the pdf syndication doesn't exist in the latest Contao versions.
Hello Fritz,
here is grashalm again. i am the customer of aybee. is it now possible to select the pdf button in the sharebuttons extension module to integrate the module in the layout? I don't see the pdf button there. So I can't select it to display under every page in the layout. all other 10 elements are displayed and also work. what is special about me: i use a self-created png graphic for these 11 elements and the pdf button is the third from last. however, I'm not sure if this fact contributes to the pdf button not being displayed.
in our previous thread, aybee wrote: "Unfortunately, the PDF generation now only works if the option is checked in the article. The customer uses the sharebutton module included in the layout, to show them page wide."
and you replied with: "Yeah, this is actually deliberate. Otherwise every page could be printed with the GET parameter, even though it was not enabled. This is not intended nor desirable. I changed it so that PDF printing only works if you enabled it in the article or a share buttons content element. But I think it is feasible to expand the check to a share buttons module included in the page layout."
my question: could you extend the check for the sharebuttons module - integrated in the page layout?
i use the latest version of your extension and contao 4.13 (as of today). if it works, do i still need the tcpdf or dompdf extension?
it would be great if you could help me here, because i haven't been able to use the pdf function for about 2 years now...
you can see it on my page https://die-schreibmaus.de
Many thanks and best regards, grashalm
Contao 4.9.9
Hallo Fritz, du benutzt die URLs zu den Artikeln z.B.
page/articles/article-alias.html?getpdf=42
um die PDFs zu generieren. Jetzt ist es aber so, dass wenn ein Newsreader im Artikel ausgegeben wird, dass der Reader dann natürlich keine News ausgeben kann und die PDF somit leer ist.Ich habe mir jetzt erstmal damit geholfen, dass ich über eine Templateänderung nicht die Links mit
.../articles/article-alias.html...
nehme, sondern sie umforme nach z.Bnews/details/news-alias.html?getpdf=42
. Dies funktioniert einwandfrei. Die Templateanpassung ist allerdings etwas aufwendig, da ich nach demautoitem
suchen muss, falls vorhanden, und auf anderen Seiten nach dempagealias
.Wieso nimmst du nicht auch direkt diese normalen Links, die Erweiterung
contao/tcpdf-bundle
von Leo nimmt die auch, und dann würde es doch funktionieren, oder habe ich da etwas nicht bedacht?