// 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]