Gossamer Forum
Home : Products : Gossamer Links : Discussions :

conditional display of fields

Quote Reply
conditional display of fields
Hi there, I'm having the following problem and I wonder if any one can provide some help?

I have added a new column (rssurl) to my links data which I only want displayed when there is valid data in the field. I have added another column (blog) which is a Radio Button that can be set to Yes - if the rssurl column contains data and No - if the rssurl column does not contain data for a specific record.

In the links.html file I have tried using the <%if blog%> construct assuming that if blog contains the value Yes then the statements in the if envelope will be executed and if it does not the statements will be ignored.

This does not seem to work and the statements are always executed.

What am I doing wrong?

All help will be gratefully received

Smokey
Quote Reply
Re: [biglouis] conditional display of fields In reply to
The reason it is probably doing that is because 'Yes' and 'No' are not recognised by the script. It needs to really be a 0 or 1 value (0=no, 1=yes). So, in your field properties, you can set the showing value as Yes or No, but the database values need to be a 1 or 0.

Hope that helps Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [biglouis] conditional display of fields In reply to
You need to use:

<%if blog eq 'Yes'%>
Quote Reply
Re: [Andy.] conditional display of fields In reply to
Andy, thanks for the incredibly fast response - I changed the values to 0 and 1 and it worked like a charm. Many thanks

Smokey aka Louis Berk http://wsindex.org
Quote Reply
Re: [Paul] conditional display of fields In reply to
Paul

Thanks for an incredibly fast response. I saw Andy's response first and amended my program accordingly. Your reply is also useful because I wondered if there was any syntax for the condtional logic. Do you know where this is documented because I could not find any reference in the Links SQL manual?

Thanks a lot

Louis
Quote Reply
Re: [biglouis] conditional display of fields In reply to
Look at the bottom of admin/GT/Template.pm

...and the Help link top-right in the admin panel.

Template Syntax & Template Tags

Last edited by:

Paul: May 6, 2002, 2:24 PM