CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • customizing custom fields with a template
Pages: [1]

Author Topic: customizing custom fields with a template  (Read 1132 times)

delvasse

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: JOOMLA
  • MySQL version: 5.1
  • PHP version: 5.2.14
customizing custom fields with a template
April 21, 2011, 06:30:49 am
Hello,

I'm looking for a tutorial to customize the length of the custom fields text boxes. I add several custom fields in the form for booking events. How can I find them in the template files ?  I would like to find a step-by-step procedure about customizing custom fields.

Thanks in advance if you can help me.

Delvasse

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: customizing custom fields with a template
April 21, 2011, 12:36:18 pm
Depending on the form, custom fields should have a unique id (custom_2_-1) or class name assigned. If this is the case for your fields I would look at using css to change field size.

Some resources for customizing templates:
http://civicrm.org/blogs/hershel/how-customize-civicrm-pages-jquery
http://wiki.civicrm.org/confluence/display/CRMDOC40/Customizing+CiviCRM+Screens
http://en.flossmanuals.net/CiviCRM/ (Extending and Customizing chapter).
Protect your investment in CiviCRM by  becoming a Member!

delvasse

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: JOOMLA
  • MySQL version: 5.1
  • PHP version: 5.2.14
Re: customizing custom fields with a template
April 21, 2011, 03:58:44 pm
Here you find 3 custom field text  boxes :
<input name="custom_1" type="text" id="custom_1" class="form-text" />
<input name="custom_9" type="text" id="custom_9" class="form-text required" />
<input name="custom_10" type="text" id="custom_10" class="form-text required" />
I can make them wider with : <style type="text/css"> .form-text { width:300px; } </style>, but how can I make them individually different ?
Thanks,
Delvasse

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: customizing custom fields with a template
April 21, 2011, 04:04:59 pm
Use their id's in your css declarations, e.g. this will set width for custom_1

<style type="text/css"> input#custom_1 { width:300px; } </style>

If you aren't already using FireFox's Firebug extension to help you with CSS - I'd recommend downloading and spending some time learning how to use it.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • customizing custom fields with a template

This forum was archived on 2017-11-26.