|
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 |
xcession Smarty n00b
Joined: 03 Jan 2005 Posts: 1
|
Posted: Mon Jan 03, 2005 5:31 pm Post subject: block plugin requiring {section} functionality - how? |
|
|
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 |
|
|
|
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
|