Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Hide blank fields

Quote Reply
Hide blank fields
Hi

I wonder if anyone can help me with information on how to hide blank fields in DBMan SQL v2.1.0?

I have searched the posts and found out it is something to do with using if/else conditional statements in the sub html_record routine but I'm not sure what to do.

Best wishes & thanks

John
Quote Reply
Re: [johnb] Hide blank fields In reply to
Hi,

I think you are looking for the following kind of conditionals that can be inserted directly into your record.html page.

<%if field_1%><%field_1%><%endif%> (this will only print field_1 if it has a value)

<%if field_1%><%field_1%><%else%>do something<%endif%> (this will print field_1 if it has a value or do something else if it doesn't)

<%if field_1 and field_2%>do something<%endif%> (this will do something if BOTH field_1 AND field_2 have values)

<%if field_1 or field_2%>do something<%endif%> (this will do something if EITHER field_1 OR field_2 has a value)

You can also use the following to test the value of the field.

<%if field_1 eq 'value'%><%field_1%><%endif%> (this will only print field_1 if it EQUALS the value)

For more detailed information -

Go to your DBManSQL Admin and click on the "Help" link on the top right of the page.
Click on the "GT Module Documentation" link second from the bottom on the left.
Scroll down to and click on the "Template" link in the left frame.
I suggest you read all of that page but in particular you are looking for the "Conditionals"
section.

Hope this helps.

Simon.
Quote Reply
Re: [jai] Hide blank fields In reply to
Thanks Simon

It's very kind of you to reply.

I'll try this out.

Best wishes

John