Feature #8989

Search path for fluid template files

Added by Christian Winther over 10 years ago. Updated almost 9 years ago.

Needs Feedback
Could have
Target version:
Start date:
Due date:
% Done:


Estimated time:
Has patch:


I'm currently working on a project where multiple extensions need to share some generic views, as well as be able to overwrite them locally.

I have made a patch for fluid that should not break in BC, but add the option for the TemplateView class to scan multiple extensions for view files.

Simply put I have added an "addExtensionSearchPath" method to TemplateView that appends extensions to a flat array (if it haven't already been added)

I have also changed so the following methods has a new optional argument called "extension" to overwrite the normal behavior of just calling "getControllerExtensionKey"

  • getTemplateRootPath()
  • getPartialRootPath()
  • getLayoutRootPath()

The protected function expandGenericPathPattern has been updated to iterate the new extensionSearchPaths class property and build search paths like before for each extension.

With the path applied you simple have to do the following in your controller to add a new search path


The search paths is processed First In First Out (FIFO) style, so your current extension always takes precedence over any additional searchable extensions added later in the request cycle.

This patch greatly improves the flexibility of the fluid rendering system, and helps keeping things DRY in your apps.

I have attached my patch to this ticket


fluid_patch.diff (7.79 KB) fluid_patch.diff Christian Winther, 2010-07-22 10:27

Also available in: Atom PDF