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

Paths in {block} are not relative to the source file but to the extended file #154

Closed
NielsJanssen opened this issue Jan 6, 2016 · 2 comments

Comments

@NielsJanssen
Copy link

When using an {include} in a {block}, the paths seem to be relative to the file that has been extended, and not to the file they're being included from. For example the following use case:

File: base.tpl

<body>
{include file="include_me.tpl"}
{block content}{/block}
</body>

File: include_me.tpl

<p>Content</p>

File in subdir, which is rendered: dir/index.tpl

{extends "../base.tpl"}
{block content}
    {include file="../include_me.tpl"}
{/block}

I'd expect this to render this:

<body>
<p>Content</p>
<p>Content</p>
</body>

Instead I get this error: [SmartyException] Unable to load template file '../include_me.tpl' in 'file:../base.tpl'

I had intended to report the exact opposite error before I updated beyond 3.1.28. As in 3.1.27 the include paths in base.tpl would be relative to the file that had extended them.

@tmihalik
Copy link

tmihalik commented Jan 6, 2016

+1
same here. Was ok in 3.1.21.

@uwetews
Copy link
Contributor

uwetews commented Jan 27, 2016

The bugfix is now in the master branch and will later be included in 3.1.30

@uwetews uwetews closed this as completed Jan 27, 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