Gossamer Forum
Home : Products : Gossamer Links : Discussions :

adding a link column

Quote Reply
adding a link column
Hi all,

On some of my products I want to add a link that is already predefined. Not all products have this link so I need to have it as a checkbox or a radio button in the add links area of the admin. Can someone tell me what the fields should be in the add column section.

-thanks
Quote Reply
Re: [tkporcel] adding a link column In reply to
can someone help me out with this please
Quote Reply
Re: [tkporcel] adding a link column In reply to
I'm not sure I understand what you want to do, but it sounds like you could just add a normal field and then use <%if Filedname%>...<%endif%> in the template. Just leave the field empty if there's no link, and it will not show.
Quote Reply
Re: [gotze] adding a link column In reply to
Thanks for the reply, I should have been more clear. I know how to add the field "<%if Filedname%>...<%endif%>" I was just unclear on what I should Put in the actual add columns spot here


Can you walk me through this I have never added a links column like this before
Quote Reply
Re: [tkporcel] adding a link column In reply to
It depends on what type of information you want the column to hold. Is it text, a radio yes/no option, etc. The best thing to do is look at an existing column with similar properties to the one you want to add and just copy the values but replace the name.

Column Name must not have any gaps so for example it might be called File_Size and the Form Display would be File Size.

Column Type depends on what the form is for. Just select from the dropdown list. VARCHAR is for a string of characters without gaps, like a URL. TEXT is a string of characters with gaps allowed. INT is a number. ENUM is for options like Yes / No when used with radio buttons, checkboxes or select.

Column Size is how many characters you are permitted to enter. Max is usually 255.

Not Null - Yes means that the form will return an error if no data is input to that field. No means that it can be left blank.

Form Type is the same as input= on a regular html form.

Form Size is the size of the field on the actual form, eg. 30, 40, 50, etc.

If it's for a radio button, Column Values will be:

Yes
No

one per line, Not Null will be Yes and Defaultwill be either Yes or No.

Form Names
and Form Values will be a repeat of Column Values

For more info go to your LSQL Admin / Database and in the editor select Links / Properties and click Go. On the page that it displayed click on any title in Column Name and on the next page there is a link for more information about what each column means. To go straight to it put this after admin.cgi? in your address bar do=editor_column_help&db=Links
Quote Reply
Re: [MJB] adding a link column In reply to
ok I almost got it but I must be doing something wrong, When I check the box to have this predefined link show up on a particular product it shows up but not as a hyperlink but a printed version ie:) looks like this http://www.predifinedlink.com instead of Click here I think I probabley screwed one of my tags up or something in my links.html file
Quote Reply
Re: [tkporcel] adding a link column In reply to
You need to use a tag for whatever you named the column.

It sounds like you're making the column create a URL link is that correct? If so you need to call it with whatever you named the column:
Code:
<a href="<%Column_Name%>">Click Here</a>
Quote Reply
Re: [MJB] adding a link column In reply to
Ok I got it to work to kinda work, but the link always apears now even when the box is not checked in the add link section of the admin. I think it might be the code I used in links.html to call the tag this is what I have

<%if Mix_And_Match%><a href="<%Mix_And_Match%>">Click Here</a><%endif%>
Quote Reply
Re: [tkporcel] adding a link column In reply to
What are the possible values of Mix_And_Match? I'm guessing you need something more like

<%if Mix_And_Match eq 'Yes'%><%a href="predefined_url">Click Here</a><%endif%>
Quote Reply
Re: [afinlr] adding a link column In reply to
Mix and match is just a link that goes to a static page, some products/links have this option and some do not
Quote Reply
Re: [tkporcel] adding a link column In reply to
OK - I'm just a bit confused about how it is a checkbox. If you check the box does the field have the URL value - so it is a fixed URL for all links? And otherwise - if the box isn't checked, what is the value of the field? Is it NULL?
Quote Reply
Re: [afinlr] adding a link column In reply to
if I check the box the link has the url http://www.abc.com if I don't have the box checked the link is not there I only want the link to be on certain products

Last edited by:

tkporcel: Mar 21, 2006, 5:15 PM
Quote Reply
Re: [tkporcel] adding a link column In reply to
I'm still not sure I understand how the field is setup. But maybe you need something like this
<%if Mix_And_Match eq 'http://www.abc.com'%><a href="<%Mix_And_Match%>">Click Here</a><%endif%>
Quote Reply
Re: [afinlr] adding a link column In reply to
This is how I have it set up



There is a default link that never changes, the only thing that changes is that sometimes it will be added to a link and sometimes it will not be by way of a checkbox in the admin section of the add links.
Quote Reply
Re: [tkporcel] adding a link column In reply to
OK - that's better - now I can see what you're doing.

If I were you, if you are only ever going to have one url, I would change the default value to 'No' and the Form Names and Form Values to both be

No
Yes

Then in your template you can have
<%if Mix_And_Match eq 'Yes'%><a href="http://www.abc.com/LP/mixandmatch.html">Click here</a><%endif%>
Quote Reply
Re: [afinlr] adding a link column In reply to
nope, When I tried that the link does not appear at all