DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Add a link as content element¶
Go to the page that you want to have a docx version and add a new content element. Click on the Doc Creator link option:
Add a link in your Typoscript Template using makeDocLink¶
To add a link to the Docx page, you can wrap any content element in a link using stdwrap.postUserFunc. The following code gives some examples:
[...]
temp.DOCI = IMAGE
temp.DOCI{
file = fileadmin/images/file_doc.gif
stdWrap.postUserFunc = tx_doccreator->makeDocLink
stdWrap.postUserFunc.target =_blank
stdWrap.postUserFunc.no_user_int = 0
}
[...]
[...]
temp.DOCT = TEXT
temp.DOCT{
value = docx
postUserFunc = tx_doccreator->makeDocLink
postUserFunc.target = _blank
postUserFunc.no_user_int = 0
}
[...]
[...]
page.120 < temp.DOCT
page.128 < temp.DOCI
[...]
If you use the Template Auto-Parser extension and you want to put the link somewhere on your page on every page, you may need to put it in a COA with another element. If you want to place it below the content, for example you need to change:
subparts.content < styles.content.get
to something like
subparts.content = COA
subparts.content {
10 = CONTENT
10 < styles.content.get
20 < temp.DOCT
}
and define temp.DOCT like above.
Please note that the link will be generated as a USER_INT object by default, i.e. that the link will be generated after the page has been pulled from the cache. If you want to go for maximum performance you can disable that with the parameter postUserFunc.no_user_int = 1 which will generate and cache the link. This is only recommended if you are sure that there are no USER_INT objects on the page that set POST or GET parameters. If you don't understand what i'm writing about leave it at default.