Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Send more than 1 param from template to a model function?

Go to End

4 Posts   1555 Views


Community Member, 41 Posts

11 May 2007 at 10:30am

How can i send more than 1 parameter from template to this function?

class ProductPage_Image extends Image {
function generateThumbnail(GD $gd, $width, $heigth) {
return $gd->paddedResize($width,$heigth,"F0F0F0");

public function Thumbnail($width,$heigth)
return $this->getFormattedImage('Thumbnail',$width, $heigth);

i try:

<ul id="ListaProductos">
<% control Children %>
<div class="Productonombre"><a href="$Link">$Title</a></div>
<div class="Productofoto">$Foto.Thumbnail(80,70)</div>
<div class="Productodescripcion"><p>$Content.FirstSentence</p></div>
<% end_control %>

But dint work, i get 1 parameter missing for Thumbnail function.



Administrator, 690 Posts

11 May 2007 at 3:52pm

The templating language has some weird little quirks in it.

Instead of:


<% control Foto %>
<% end_control %>

While we're on the subject, if anyone want to try and help rewrite the SSViewer parser, I'd be very appreciative and happy to point them in the right direction. :-)

Basically, it's currently built as a mess of regular expression search-and-replaces. It needs to be turned into a more sophisicated parser that uses a regular expression to find the <% control %> and $ tags, and something based on explode() and a for loop to work out how to parse the field/method reference itself.


Community Member, 41 Posts

11 May 2007 at 11:23pm

Thanks i will give it a try.


Community Member, 41 Posts

12 May 2007 at 9:56am

Yes, That resolve my problem tank you very much.