Gossamer Forum
Home : Products : Links 2.0 : Customization :

&build_radio_field in Templates too?

Quote Reply
&build_radio_field in Templates too?
It is referenced in links.def "If you use &build_radio_field, it will make a <INPUT TYPE="RADIO"> tag", which I assume is in the admin interface. Is there anyway to also pull this into add_error.html, modify.html, etc., as opposed to manually building the <INPUT TYPE="radio"... code? I have found no reference to this, other than a mod to site_html_add_failure by Bobsie ( http://www.gossamer-threads.com/...um3/HTML/000993.html ).
Quote Reply
Re: &build_radio_field in Templates too? In reply to
You could do it, but not in add_error.html. You would have to do it in the appropriate subroutine of site_html_templates.pl by adding this code to the template load code:

Quote:
$radio_button => &build_radio_field($fieldname),

where $radio_button is the name you want to use in the <%...%> tag in the template, and $fieldname is the name of the field (defined in %db_radio_fields) you want the radio button for. Since the %db_radio_fields array is defined in both category.def and links.def, the array is available for use anywhere in Links, not just the admin screen.

I should note though, that you cannot do this for the error templates. For those, you need to know what was recorded by the user originally. So, you would have to change the call to:

Quote:
$radio_button => &build_radio_field($fieldname, $value),

where $value is the value the user entered on the add or modify form.

I hope this helps.

[This message has been edited by Bobsie (edited August 22, 1999).]
Quote Reply
Re: &build_radio_field in Templates too? In reply to
Thank you. I implemented the other way you described in the thread above, which works fine, so I am not tempted mess up a good thing (at least until I have time to kill Wink