2
votes

Will there be a feature I don't know for TYPO3 fluid templates?

For some extensions (e.g. powermail, news) there are many templates for functions I don't use. But if I want to adapt a single template, all of them have to be copied. Will be there an alternative way where I can set a single template path?

4

4 Answers

1
votes

This is currently not possible by the means of the FLUID core.

However, there is the extension view that allows to do exactly what you want, and a feature request to move that functionality to the FLUID core.

1
votes

Since TYPO3 v6.2 it is possible to add multiple template, layout and partial paths. Simply use something like this.

plugin.tx_myextension {
    view {
        templateRootPath >
        templateRootPaths {
            10 = EXT:myextension/Resources/Private/Templates
            20 = fileadmin/templates/myextension/Templates
        }

        partialRootPath >
        partialRootPaths {
            10 = EXT:myextension/Resources/Private/Partials
            20 = fileadmin/templates/myextension/Partials
        }
    }
}

Remember: The extension is starting to search for the file beginning with the highest number and ends with the lowest, where you should add the extensions default path.

1
votes

Current syntax: add the following to your own extension's constants file and load it after Powermail's own. The same syntax applies to partialRootPath and layoutRootPath.

You only need to copy the individual file you want to customize - respecting the original folder structure - and not the entire folder. TYPO3 will search for the file in all of the paths indicated in the ...rootPaths array, starting with the highest-numbered entry.

By using the singular form ...rootPath and not ...rootPaths, your definition will be appended to the generated ...rootPaths array. Therefore, adding the following to your constants…

plugin.tx_myextension {
    view {
        templateRootPath = EXT:myextension/Resources/Private/Templates
    }
}

…will generate…

plugin.tx_myextension {
    view {
        templateRootPaths {
            0 = EXT:powermail/Resources/Private/Partials/
            1 = EXT:myextension/Resources/Private/Templates
        }
    }
}
0
votes

I don't think so... Just copy whole folder into for an example fileadmin/ext/powermail (also with partials!) and then change the paths in the extension's TS constants .

To make it working on the single files developers should implement such behavior directly in their extensions, but it would be quite uncomfortable solution (for developers and for users as well)