-
Notifications
You must be signed in to change notification settings - Fork 714
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
Change in extends behaviour around v3.1.28 #296
Comments
from INHERITANCE_RELEASE_NOTES.txt:
|
Thanks for the quick reply @artcs - so if i understand you correctly, in this minor update backwards compatibility (in this respect) has been abandoned, and it's no longer possible to replace a tag {extends} in a template with a resource extends when doing fetch in PHP. Thanks for pointing out INHERITANCE_RELEASE_NOTES.txt which i hadn't spotted as I wasn't really expecting an overhaul of this significance in the 3.1 branch, somewhat surprised this wasn't left for 3.2 or even 4.x, anyway too late now i guess. I tried using the $smarty->inheritance_merge_compiled_includes = false just in case but i see even that workaround has been removed in 3.1.30 (and i don't think had any bearing on the extends system anyway). Any other suggestions would be greatly appreciated. Sadly our project is now so completely dependant on being able to do this it looks like we will be stuck on an out of date version until we change or replace our templating system... |
Shouldn't be hard to fix. Your problem is, that the {extends} tag is no longer ignored, so you have to work around that. Instead of your |
Thanks, i guess that's all we're left with, although i reckon that's very far from not hard to fix with over 1000 template files... won't be happening for this release anyway. |
You could replace your |
Good thinking @artcs - i think there's only a hundred or so with that extends tag in, so not such a biggie probably, would need some serious testing re the other 900 tpls though! ;) Thanks for the tip, will try that later. |
I will update the master branch with a flag to enable and disable the new feature. |
…ution of {extends} in templates called by extends resource #296
There is an update in the master branch. |
…ution of {extends} in templates called by extends resource #296
…ution of {extends} in templates called by extends resource #296
Many thanks for adding that @uwetews - will look into it for our next release! :) |
Hi, excuse the long post
I work on the Tiki project and we have been unable to upgrade our version of Smarty since v3.1.21 for various reasons. I have an almost totally working implementation now with 3.1.30 but am stuck on one issue, which is in the way the
extends
resource seems to be working now.We have many (100+) templates that start
{extends 'layout_view.tpl'}
which by default loads the complete page with head, body, menus etc, but when used via a service this needs to be overridden so itextends
a simpler template, such aslayouts/internal/layout_view.tpl
which is done in the services broker using a line (in PHP) like:$smarty->fetch("extends:layouts/internal/layout_view.tpl|list_friends.tpl");
Before 3.2.28, this overrides the {extends} tag in the template and uses this minimal one which only has the content block defined in it for dialogs etc.
In 3.1.28 and up this seems to be ignored and the tag is used instead of the added resource, and this can be proved by changing the extends tag to ask for a file that doesn't exists and i get a simple error message. Commenting out this line makes the php added resource be used as expected.
So is this no longer possible in Smarty >= 3.1.28? In which case i think we are stuck.
Or are we doing something wrong?
Thanks in advance,
jonny B
The text was updated successfully, but these errors were encountered: