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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How Custom Fields Display
Pages: [1]

Author Topic: How Custom Fields Display  (Read 1730 times)

Jeremy

  • Guest
How Custom Fields Display
April 10, 2012, 10:04:08 am
Hello, CiviCRM folk.
I'm fairly new to this project and haven't themed it before.

I would like to pull the custom fields out of the accordion container they live in (both in the create Event page and the event info page itself) and make them a part of the page with the other, basic fields. Is this a setting within the system or something I need to do in templates. If the latter, does anyone have snippets of code that might be able to accomplish what I want simply, without needing me to tear apart templates?

Thanks so much for listening to my nooblet question.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How Custom Fields Display
April 10, 2012, 10:44:14 am
Perhaps you need to check the Webform - CiviCRM integration ( http://civicrm.org/blogs/colemanw/civicrm-and-webform-module-together-last)? I am assuming it is the data you want to retrieve from the database to display on another spot than on the standard UI?
Alternative is to use the API to retrieve the data in the template where you want it to appear, check http://book.civicrm.org/developer/techniques/templates and http://book.civicrm.org/developer/techniques/api
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Jeremy

  • Guest
Re: How Custom Fields Display
April 10, 2012, 11:13:55 am
Erik, is it necessary to implement the API just to move a couple of custom event fields (which already display as they should) up in an Event Information page?

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How Custom Fields Display
April 10, 2012, 11:17:30 am
Hi Jeremy, you make it sound as something difficult  :)
First of all, I am not sure what you mean by implementing the API, it is part of CiviCRM? And generically speaking, picking up data to be displayed somewhere else is something that I use the API for as it is very simple? What CMS are you using?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: How Custom Fields Display
April 10, 2012, 11:25:00 am
Jeremy - if I'm understanding you correctly, you just want to reorder some pages on a registration form - is that correct?

You shouldn't need the API for that (since, as you point out, the fields already exist on the form).  You might be able to even pull it off with CSS alone if you're a CSS wizard, but I'd probably use a line or two of jQuery myself.  This article has a description of how to use the .append method: http://www.elated.com/articles/jquery-removing-replacing-moving-elements/

Also check out this blog entry, which describes how to add jQuery to a template without editing the .tpl file itself: http://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Jeremy

  • Guest
Re: How Custom Fields Display
April 10, 2012, 11:27:01 am
It's a Drupal 7 install. I apologize if I made it seem more complicated than it is but I'm a bit wary of modifying templates and such.

Find a VERY basic, unthemed example here: http://awesomescreenshot.com/0bc376a2d

I essentially just don't want the custom fields as a separate table within the display. I wanted to theme them so they're consistent in appearance to say, Location, or Description.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How Custom Fields Display
April 10, 2012, 11:18:11 pm
Hi Jeremy, I thought it was more complicated than it turned out to be. If you want to modify the appearance of the custom fields you will probably be best off with jQuery as JonGold suggests....but I am no jQuery wizard myself. So I would probably personally change the template and remove some of the class identifiers....or change them in the css.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: How Custom Fields Display
April 13, 2012, 01:20:32 pm
Hi Jeremy,

Agreed - you definitely shouldn't change how your data is stored to get a change in presentation!

Changing the template is easy enough, but a line or two of jQuery is an equally valid option.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How Custom Fields Display

This forum was archived on 2017-11-26.