[TYPO3-english] Print Friendly TemplaVoila page with global caching

Marc Petralito koma666 at me.com
Wed May 5 15:44:04 CEST 2010


Hi there

In fact this really did the trick!
I already had the first part, but I didn't had the
"// Changes to the link for when we are ON a print page:
[globalVar = GP:print > 0] ..."

Means I activate the cache without this second part, it won't work, but 
as soon as I add it, it works.

Thanx alot for the help!

Marc

On 5/5/10 12:05 PM, Riccardo De Contardi wrote:
>
> Hello.
>
> What about this snippet taken from typo3apprentice?
>
>
> // Create a link to a printable version of the current
> // page--complete with all GET parameters needed by
> // extensions:
>
> lib.print_link = TEXT
> lib.print_link {
> // The link text:
> value = Print view
> typolink {
> // Get the id of the current page:
> parameter {
> data = page:uid
> }
> // Add whatever is in the query string:
> addQueryString = 1
> addQueryString {
> // Account for the fact that RealURL etc
> // may have manipulated the query string:
> method = GET
> }
> // Add the 'print' parameter:
> additionalParams = &print=1
> // Do not cache the print version:
> no_cache = 1
> }
> }
> // Changes to the link for when we are ON a print page:
> [globalVar = GP:print > 0]
> lib.print_link {
> // The link text
> value = Normal View
> typolink {
> // Unset the print parameter:
> additionalParams >
> // Make sure we don't turn off
> // the cache for the REGULAR
> // version of the page:
> no_cache = 0
> // Add the entire query string
> // for the current location,
> // EXCEPT for the print and
> // no_cache parameters we
> // introduced:
> addQueryString.exclude = no_cache,print
> }
> }
> [global]
>
>
>
>
> In data 05 maggio 2010 alle ore 11:33:48, Marc Petralito
> <koma666 at me.com> ha scritto:
>
>> Hi there,
>>
>> We have a subtemplate for one of our main TemplaVoila templates to
>> display a printer friendly version of our sites ("Render Type: Printer
>> Friendly"). The print preview is basically the content + a header image.
>> When deactivating the caching (config.no_cache=1) everything works
>> fine with the print (a new window opens using the templaVoila print
>> template).
>>
>> As soon as we activate the cache, the printlink still opens a new
>> window but with the normal page (from the cache I assume), not the
>> print friendly version. Although we have used the &print=1 and
>> no_cache=1 for the print link.
>>
>>
>> Is there a way to use global caching and at the same time take the
>> right template?
>>
>> Kind regards,
>>
>> Marc Petralito
>>
>>
>
>



More information about the TYPO3-english mailing list