Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included template can't be find in the scenario of template inheritance #218

Closed
lubobill1990 opened this issue Apr 14, 2016 · 3 comments
Closed

Comments

@lubobill1990
Copy link

In the following scenario:

  1. a.tpl is parent template
  2. b.tpl is child template
  3. c.tpl is included by b.tpl with relative path
  4. d.tpl is included by b.tpl with relative path

then, smarty 3.1.30@dev will occur the following error:

Unable to load template file '../d.tpl' in 'file:./c.tpl'

@lubobill1990 lubobill1990 changed the title include a relative path template within a template which is included with relative path will fail Included template can't be find in the scenario of template inheritance Apr 14, 2016
@uwetews
Copy link
Contributor

uwetews commented Apr 14, 2016

Can you provide your folder structure and some sample template please

@hauke725
Copy link

hauke725 commented Apr 22, 2016

Files:
https://gist.github.com/hauke725/850c993de206dae6f83c439f6fe86114

This won't work if both the included templates are in a subdirectory. When the second include's path is described from the dir of the parent template it works, even if the parent template is not in a resource root.
This problem seems to be occuring since 3.1.28

uwetews added a commit that referenced this issue Apr 24, 2016
@uwetews
Copy link
Contributor

uwetews commented Apr 24, 2016

The fix is now in the master branch

@uwetews uwetews closed this as completed Apr 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants