|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mataniko Smarty n00b
Joined: 31 Jul 2018 Posts: 3
|
Posted: Tue Jul 31, 2018 2:03 pm Post subject: Using {extend} in a loop |
|
|
Whats the best way to combine a loop and {extend}?
I have a template that is simply a container with a header and a body that I want to reuse multiple times within a page.
Is {extend} just not the right tag for this use case? It's a lot easier to use and read over passing html blocks as variables in an {include} tag. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jul 31, 2018 7:04 pm Post subject: |
|
|
You can't use {extends} INSIDE a template, at all.
It should be used outside all tags, and only tags allowed on the same level are {block} tags. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jul 31, 2018 10:25 pm Post subject: Re: Using {extend} in a loop |
|
|
mataniko wrote: | It's a lot easier to use and read over passing html blocks as variables in an {include} tag. |
This sounds much like an XY problem.
Can you please explain, what are you trying to achieve, from the beginning? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|