Closed medarob closed 5 years ago
Using a separate page type for each PDF could be one solution. But then you need to make sure that you also include the setup from Configuration/TypoScript/Extensions/News/setup.txt
for that page type.
Another way could probably be to add a GET parameter pdf_type=2
and then use a TypoScript condition to set the template path:
[globalVar = GP:pdf_type = 2]
plugin.tx_news {
view {
templateRootPaths >
templateRootPaths {
0 = EXT:pdfviewhelpers/Resources/Private/Templates/Extensions/News/TemplatesV2/
}
}
}
[global]
Or you could even do it in the Fluid template:
<f:switch expression="{news.type}">
<f:case value="job">
<f:render partial="News/Job" arguments="{news: news}" />
</f:case>
<f:case value="news">
<f:render partial="News/News" arguments="{news: news}" />
</f:case>
</f:switch>
But then you also need to add the path to your partials to partialRootPaths
:
plugin.tx_news {
view {
partialRootPaths >
partialRootPaths {
0 = EXT:news/Resources/Private/Partials/
1 = fileadmin/templates/ext/news/Partials/
}
}
}
Each partial would then contain a separate PDF document. I would probably go for the Fluid version.
Thank you, I will try this approach :)
Hi,
not really an issue but maybe feature, if not already possible: I have the news extensions installed and using it for normal news and also job descriptions. And maybe there are other use cases for the news extensions... Now I want the news pdfs look different than the job pdfs.
Is that possible somehow? Do I have to use different page types for different news pdfs?
Thank you