[each] loop + [if field … ]
-
sorry, hate coming up with subjects … hopefully my ask is better …
Hopefully I’m asking this in the right place .. the repeater field is implemented with Panda, so I’m figuring it has something to do with how its being linked …
I’ve got a pod created that defines a staff member for a spa, and I’ve added a ACT using Panda pods to define their hourly rates … it all set up great, I can enter data, I can see it on the backend … and I can even see it ( sort of ) on the front end, but I’m trying to do something that i’m jus tnot figuring out …
I made a Pod Template:
<center>
<table width=75% border=1>
[each hourly_rates]
<tr>
<td width=25%>{@time_label}</td>
<td width=25%>$ {@service1}</td>
<td width=25%>[if field=”service2″ value=”0″ compare=”>”]$ {@service2}[/if]</td>
<td width=25%>$ {@service3}</td>
</tr>
[/each]
</table>
</center>But I can’t get the if statement to work … if I take the if statement out, the value for @server2 shows properly … with the if statement there, then the table entry is empty, as if the if is returning FALSE, so I’m thinking I’m somehow referencing the fields wrong … ?
the ACT is defined as a table, and as:
> describe wp_gtuqdz_pods_rate_table;
+————————-+—————–+——+—–+———————+—————-+
| Field | Type | Null | Key | Default | Extra |
+————————-+—————–+——+—–+———————+—————-+
| id | bigint unsigned | NO | PRI | NULL | auto_increment |
| time_label | decimal(4,0) | YES | | NULL | |
| service2 | decimal(4,0) | YES | | NULL | |
| service1 | decimal(4,0) | YES | | NULL | |
| service3 | decimal(4,0) | YES | | NULL | |
| pandarf_parent_pod_id | int | NO | | NULL | |
| pandarf_parent_post_id | int | NO | | NULL | |
| pandarf_pod_field_id | int | NO | | NULL | |
| pandarf_order | text | NO | | NULL | |
| pandarf_created | datetime | NO | | 0000-00-00 00:00:00 | |
| pandarf_modified | datetime | NO | | 0000-00-00 00:00:00 | |
| pandarf_modified_author | int | NO | | NULL | |
| pandarf_author | int | NO | | NULL | |
| pandarf_trash | int | NO | | 0 | |
+————————-+—————–+——+—–+———————+—————-+
14 rows in set (0.00 sec)I’ve checked the backend … when I leave a field blank during data entry ( ie. service3 is blank ), it gets a value of 0 in the field, which is why I’m asking it to display a value *only* if that field is > 0 …
I’m always happy with a pointer to RTFM, but am hoping that its something stupid that I’ve just not tried or found in my searches of the docs to date …
Thanks for your patience, any help appreciated …
- The topic ‘[each] loop + [if field … ]’ is closed to new replies.