Question

The directory is setup like this:

common/base.tpl
main/foo.tpl
main/extras/bar.tpl
special/foo.tpl
special/bar.tpl

In main/foo.tpl, the regular {extends file="common/base.tpl"} works just fine. In special/foo.tpl, the {extends file="main/foo.tpl"} works just fine as well.

The issue I'm having is extending main/extras/bar.tpl. Nothing I've tried will extend this document. If I move it out of main/extras and just into main/ everything works like the foo example. I've even tried special/extras/bar.tpl and that doesn't work either.

So how do you extend a document in a subdirectory? I've set $this->smarty->use_sub_dirs = true; and this has no effect.

Was it helpful?

Solution

So I found the answer. It has to do with the rendering order of extends and includes in that the extends are rendered after the includes so the extends are not inherited down the line. So basically you need to use or the other, or both but not including/extending each other.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top