Gossamer Forum
Home : Products : Links 2.0 : Customization :

Defining a Checkbox in Links.def ???

Quote Reply
Defining a Checkbox in Links.def ???
Greetings

I have created some extra fields to links.def to allow more detail about specific links.

I also have added a field called $db_build_detail which is intended to be a switch to tell Links whether or not to generate a details page for this particular entry. [I have not got on to this part of the code yet 8)].

What I want to know is: is there syntax for adding a checkbox field through Links.def ???

Thanks for your help ... Smile

Don
Quote Reply
Re: Defining a Checkbox in Links.def ??? In reply to
Thanks Alex,

I am working with Links 2 Beta 4 but waiting for the final version before I try changing the code.

The main thing I want to know is how to use the links.def, table definition to define a variable to be shown in the automatically generated forms as a checkbox.

The detail views in Links 2 are great, However, if you choose to generate detail pages, then links from all category pages go to the detal view.

I want to creat the option of only generating the details page where there is detail to view. If there isn't any detail, then I want the category page to go straight to the link.

That is why I need [want] to define a checkbox in links.def so I have a switch field to use in the code.

I hope this is a clearer description of what I am looking for.

Thanks very much. Smile

Don

Quote Reply
Re: Defining a Checkbox in Links.def ??? In reply to
I would move up to Links 2.0 beta which is much easier to add fields, and also has a deatiled view built in.

Cheers,

Alex
Quote Reply
Re: Defining a Checkbox in Links.def ??? In reply to
Hi Don,

To define a checkbox, add the field into %db_def (try using: http://gossamer-threads.com/scripts/dbman/build.cgi if you get stuck on the syntax).

Hmm, I just noticed the checkbox definition is missing. Smile Add:

%db_checkbox_fields = ( field_name => 'Yes' );

anywhere in links.def. And try your admin and it should be added.

Hope this helps,

Alex
Quote Reply
Re: Defining a Checkbox in Links.def ??? In reply to
Thank you Alex,

That works Smile