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

Trimmed down version of fetch function

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
rjdavid
Smarty n00b


Joined: 04 Aug 2006
Posts: 1

PostPosted: Fri Aug 04, 2006 7:39 pm    Post subject: Trimmed down version of fetch function Reply with quote

I have created a cms application framework wherein each page is composed of blocks that can be positioned anywhere in a page depending on the permissions of the user. To make the long story short, each block has its own template.

So what I am doing is something like:
1.) Retrieve all blocks info for a page for a user type
2.) Parse the template for each block (including assignments of values to the template depending on the block)
2.) For each page position (e.g. left column), I iterate all blocks displayed in that position using the output for each block

So it means that I have a main layout template wherein there are smarty foreach for each page position. And then the individual templates for each block.

What I am doing before is use smarty fetch to get the output for each block and assign it to a smarty variable again and then call smarty display function for the final output.

That is not efficient. Why? Output modifiers are being executed twice for each block template. Therefore if I am trimming spaces for my output, the function does it twice.

As for my current solution, I created another function called subfetch in my extended smarty class which is a trimmed version of fetch.

I just want to request if it is possible for such function to exist in smarty for cases outlined above.

Thanks Very Happy
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 -> Feature Requests 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