[Typo3] Print Page with Autoparser

Marlies C mc at mcuniverse.com
Thu Feb 3 21:17:12 CET 2005


"Peter Russ"  wrote in message
> ^
> 1) in CONSTANT setup the template e.g.:
> #Autoparser
> CONTENTFILE=fileadmin/tpl/icp/tpl.icp.001.html
> REL_PATH_PREFIX=fileadmin/tpl/icp/
> [globalVar = TSFE:type=98,GP:fdfxpx=1]
> #PRINTING
>     CONTENTFILE=fileadmin/tpl/icp/tpl.print.html
> [end]
>
> 2) SETUP the auto-parser to your needs
> # Configuring the Auto-Parser:
> plugin.tx_automaketemplate_pi1 {
>     # Read the template file:
>     content = FILE
>     content.file = {$CONTENTFILE}
>     # Here we define which elements in the HTML that
>     # should be wrapped in subpart-comments:
>     elements {
>         BODY.all = 1
>         BODY.all.subpartMarker = DOCUMENT_BODY
>         HEAD.all = 1
>         HEAD.all.subpartMarker = DOCUMENT_HEADER
>         HEAD.rmTagSections = title
>         TD.all = 1
>         DIV.all=1
>     }
>     # Prefix all relative paths with this value:
>     relPathPrefix= {$REL_PATH_PREFIX}
>     relPathPrefix.A = /
> }
>
> 3) Instruction for printing in SETUP
> #Printlink
> temp.PRINT = IMAGE
> temp.PRINT{
>     file = {$MAIN.IMAGE.HEADER.PRINT}
>     params=id="{$alt_print_SWAP_IT}"
>     stdWrap.postUserFunc = tx_make_printlink
>     stdWrap.postUserFunc{
>         include_post_vars = 1
>         target = _blank
>         popup = 1
>         swapIt= {$alt_print_SWAP_IT}
> //one line
>         windowparams 
> =resizable=yes,toolbar=no,scrollbars=yes,menubar=no,width=720,height=500
>
>     }
> }
> [globalVar = TSFE:type=98]
> temp.mainTemplate {
>    workOnSubpart = DOCUMENT_BODY
>     #Substitute markers
>     marks {
> __FDFX_BM_PATH.1.NO.doNotLinkIt=1
>         PAGE_TITLE = TEXT
>         PAGE_TITLE.field = title
>         PAGE_SUBTITLE = TEXT
>         PAGE_SUBTITLE.field = subtitle
>         PAGE_AUTHOR = TEXT
>         PAGE_AUTHOR.field = author
>         PAGE_AUTHOR.required=1
>         PAGE_AUTHOR.typolink.parameter.field = author_email
>         PAGE_UID = TEXT
>         PAGE_UID.field = uid
>         PRINT_ICON < temp.PRINT
>         CONTENT < styles.content.get
>     }
> }
> [else]
> temp.mainTemplate {
>    workOnSubpart = DOCUMENT_BODY
>     #Substitute markers
>     marks {
>         PRINT_ICON < temp.PRINT
>     }
> }
> [end]
> #Print Page
> alt_print >
> alt_print = PAGE
> alt_print{
>     headerData.10  < temp.headTemplate
>     typeNum=98
>     bodyTag=<body onload="window.print()">
>     10 < temp.mainTemplate
> }
>
> Works for me.
>
> Regs. Peter.

Thanks Peter.

Just reading through the code I realize that you created a special print 
template, whereas I created a print stylesheet that only contains the 
contents I want to print and uses the regular html template.

How do I tell the setup to use that stylesheet for printing?

Thanks
Marlies
www.mcuniverse.com





More information about the TYPO3-english mailing list