The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smarty Templating
Hey Steven,

Yes, both are definitely possible, but may take some fiddling.

1. I don't quite follow exactly what you need, I must admit. I get the general gist, but the details escape me. You can't reference a specific value within the variables passed to the template unless you know exactly where the value is (row + column) within the var - which is probably unlikely, since the contents are dependant on the current form, View, search criteria and order.

What you might want to try is looping through the $submission var TWICE - the first time extracting whatever value you want based on your criteria. e.g. this grabs the first value in the "X" column:

{assign var=my_val value=""}
{foreach from=$submissions item=submission name=row}
    {foreach from=$display_fields item=field name=col_row}
      {assign var=col_name value=$field.col_name}
      {assign var=value value=$submission.$col_name}
      {* if this is column X, grab the value *}
      {if $my_val == "" && col_name == "X"}
        {assign var=my_val  value=$value}

{* this outputs the value *}

2. Depending on your data set, this may be simpler. What you could do is again put multiple loops through the $submissions var, omitting results in each data set that don't match a particular criteria.

Sorry, it's really tricky to give helpful advice on both of these question - this is something that really needs to be played around with directly.

- Ben

Messages In This Thread
Smarty Templating - by stevenheidel - May 13th, 2009, 7:32 PM
RE: Smarty Templating - by Ben - May 13th, 2009, 8:14 PM
RE: Smarty Templating - by stevenheidel - Jun 24th, 2009, 1:50 PM
RE: Smarty Templating - by Ben - Jun 26th, 2009, 9:00 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)