Display name of Boolean column

0

I have a number of Boolean columns setup. I'm not sure how to code the template in order to display the name value. Right now it's just displaying a 0 or 1. I'm a rookie at this PHP thing so any help would be appreciated.

asked Jul 16 '10 at 4:50

mortensn

1

add comment
enter at least 15 characters

2 Answers

0

Can you give some example code of how you are displaying it? The boolean fields always store a 0 or 1 in the database (hence the "boolean" type), so I'm not exactly sure what other data you are trying to get from it. Are you trying to get the column name?

answered Jul 16 '10 at 5:58

clarinetlord

456

Yes. When the checkbox is marked as True I'd like my template to then display the column name. When not-marked (false) I'd like the column to not be listed. – mortensn Jul 16 '10 at 6:00
Yes. When the checkbox is marked as True I'd like my template to then display the column label. When not-marked (false) I'd like the column to not be listed. – mortensn Jul 16 '10 at 6:01
Here is my current code. Obviously it just returns a 1 or a 0. <h3>AMENITIES</h3> <div id="amenities">{@amen_uta}</div> – mortensn Jul 16 '10 at 6:09
add comment
enter at least 15 characters
0

Try this code for your template: <pre><code><?php if ({@amen_uta}==1) { ?> <h3>AMENITIES</h3> <div id="amenities">(put your column name or something here)</div> <?php } ?></code></pre>

Does it work?

answered Jul 17 '10 at 10:40

Masino Sinaga

41

edited Jul 17 '10 at 10:46

add comment
enter at least 15 characters