Gossamer Forum
Home : Products : Gossamer Links : Discussions :

how to display form_values instead of form_names?

Quote Reply
how to display form_values instead of form_names?
Hi,

this may be an obvious one, but I can't seem to figure it out (nor found a solution in the forum).

I defined a custom column called 'Lang1' (varchar) in the links table to be displayed as multi-select form field, where 'form_names' are defined as 'de', 'en' 'fr' and so on while 'form_values' are 'Deutsch', 'Englisch', 'Französisch' etc.
Now I'd like to display the content of this column on the links detail pages. When using the tag '<%Lang1%>' I get 'de#en#fr' for example - which is not surprising because that's what is stored in the database.
Now I would like this to be displayed as the corresponding 'form_values': 'Deutsch, Englisch, Französisch' (ideally the values separated by comma).
I know I have to define some global tag for that, but I just can't get it to work. Which subroutine do I have to call for that?
Unfortunately the documentation of GT::SQL::Display::HTML isn't available. The corresponding link in the online help is broken...

Any ideas?


Andreas
http://www.archaeologie-online.de
Quote Reply
Re: how to display form_values instead of form_names? In reply to
I'm not sure what you are asking.

To use a multi-select box, you need to have some back end processing, since the options and the display mode are different. It's like a standard select box, except you can't asssume the value in the field is the 'selected' value, since there might be multiple.

The box is only "auto generated" in the "Admin" area. If your box looks right in the Admin, then you set it up properly.

You need to code it vial HTML in the add/modify forms, using the same sort of logic as for the <%Category%> tag (see the routines in those .cgi's).

To add the values, you need to use the format:

'value1'
'value2'


Where each value is enclosed by '' and separated by a newline.




PUGDOG® Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: how to display form_values instead of form_names? In reply to
Hi,

to display the form is not my problem. This works fine on my 'add links' page and in the admin.
I just want to print out the contents of the column, i.e. the 'aliases' of the values that are stored in the database. Almost the same way it is done when I do a search for an entry in the admin and the results are displayed. There the categories of a link, for example, are just listed (as text, not form) the same way as the 'aliases' of my custom column (that is: what I typed into the field 'Form Values (Displayed on Form)' in the column definition screen in the admin).

I searched through the admin scripts, but could not find the right place / subroutine or hook where the display of these parts of the search result page are generated.
LinksSQL is quite a complex piece of work Blush

BTW: I'd like to display all the categories a link belongs to on the details page, too. Not quite sure if this could be accomplished in the same way as the custom columns, but should be similar - or am I totally wrong with that?


Andreas
http://www.archaeologie-online.de
Quote Reply
Re: how to display form_values instead of form_names? In reply to
check out the file /GT/SQL/Display/HTML.pm

I think the codes are in that one for the generation of select boxes.

(GT's forum sort of crashed, and I lost the message I originally typed, with the file name, that's what I remember, so it might not be exact).

PUGDOG® Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum