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

block plugin requiring {section} functionality - how?

 
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 -> Plugins
View previous topic :: View next topic  
Author Message
xcession
Smarty n00b


Joined: 03 Jan 2005
Posts: 1

PostPosted: Mon Jan 03, 2005 5:31 pm    Post subject: block plugin requiring {section} functionality - how? Reply with quote

Hi All.

I'm trying to create a block plugin to allow me to output variables i've assigned to the smarty engine, wrapped with html which allows some kind of WYSIWYG functionality, details of which are pretty irrelevant.

Due to how i've planned it to work, I'd also want my block plugin to be loopable like a {section} block too, only without having to actually specify that {section} code at the template level.

My ideal template code would read thus:

Code:

<ul>
{my_wysiwyg_block obj=$foo}<li>$foo</li>{/my_wysiwyg_block}
</ul>


The "my_wysiwyg_block" plugin, would ensure that if i had assigned() 5 different $foo objects, it would output 5 <li></li> lines.

The question is, how would i go about getting the {section} functionality, inside the my_wysiwyg_block plugin? I'd need to be able to work out how many $foo there were, when it was the last, etc - just like {section} so it seems the most logical way of doing it.

I can't simply put a {section} block in the template, as i need to know data which the {section} block usualy provides (such as a count of all the $foo found), to modify how the WYSIWYG stuff gets output. If there are no $foo found, it outputs different buttons to if there were 2, for instance.

Any ideas welcomed.
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 -> Plugins 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