[TYPO3-mvc] Setting paths to partials for individual configurations
Michael Knoll
mimi at kaktusteam.de
Thu Aug 19 16:14:33 CEST 2010
I found the following solution:
Since paths for partials are resolved in the view class, I overwrite
resolvePartialPathAndFilename():
class Tx_PtExtlist_View_BaseView extends Tx_Fluid_View_TemplateView {
protected function resolvePartialPathAndFilename($partialName) {
if (file_exists($partialName)) { // partial is given as absolute path
(rather unusual :-) )
return $partialName;
} elseif (file_exists(t3lib_div::getFileAbsFileName($partialName))) {
// partial is given as
EXT:pt_extlist/Resources/Private/Partials/Filter/StringFilter.html
return t3lib_div::getFileAbsFileName($partialName);
} else { // partial is given in the "ExtBase" way
return parent::resolvePartialPathAndFilename($partialName);
}
}
}
Perhaps you could add this to standard FLUID view?
Greez
Mimi
Michael Knoll schrieb:
> Hi there,
>
> in our extension, we have a list that can be filtered by different kinds
> of filters. Let's say we have a product list and want it to be filtered
> by product name. For those filters, we write a model, a controller, a
> view and a template with a partial that renders the filter.
>
> What we need to make this extension generic, is that the path to the
> partial may be overwritten by TS from other extensions. As far as I can
> see, the partial can only be adressed, if it resides within the
> directory set by TS for the main extension and can't be overwritten by
> any dependent extension.
>
> Is there any solution yet to face this problem?
>
> What do you think about extending the partial viewhelper and make it use
> absolute paths for the partial file?
>
> Thanks for any ideas!
>
> Greez
>
> Mimi
More information about the TYPO3-project-typo3v4mvc
mailing list