Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Using {extend} in a loop

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
mataniko
Smarty n00b


Joined: 31 Jul 2018
Posts: 3

PostPosted: Tue Jul 31, 2018 2:03 pm    Post subject: Using {extend} in a loop Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Jul 31, 2018 7:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Jul 31, 2018 10:25 pm    Post subject: Re: Using {extend} in a loop Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP