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) »
  • Hide field in default search (newbie)
Pages: [1]

Author Topic: Hide field in default search (newbie)  (Read 1212 times)

Durruti

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
    • The Kindling Trust
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.2.17
Hide field in default search (newbie)
April 17, 2008, 11:29:15 am
Hi, I'm new to CiviCRM and am finding it a very powerful tool, thankyou.  I have a question, is there an easy way to hide field in the default search? The database will only ever contain organisations so the primary field in the default search is confusing to the user. I have looked at the custom search pages, but to be honest I don't have any php/mysql skills and am out of my depth. Can I just remove the first few lines from the php or is this better not messed with?  :-\
Many thanks in advance,
Cheers
Matt
http://feedingmanchester.org.uk

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Hide field in default search (newbie)
April 17, 2008, 04:03:19 pm
Hi Matt (and welcome :-) )
The easiest way to do this (and one that's reasonably upgrade compatible) is to use the "custom templates" feature.

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

Using this method, create your custom copy of the template file: templates/CRM/Contact/Form/Search/BasicCriteria.tpl

Then remove this code - which renders the drop-down for contact types.
Code: [Select]
{$form.contact_type.html}

.... and add this hidden field somewhere in that same table (which contains the form). This will sets the contact type to always be Organization:
Code: [Select]
<input type="hidden" name="contact_type" value="Organization">

Of course you'll probably want to modify the table layout a bit as well - but you can do all that in this same template file.
Protect your investment in CiviCRM by  becoming a Member!

Durruti

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
    • The Kindling Trust
  • CiviCRM version: 3.4
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.2.17
Re: Hide field in default search (newbie)
April 20, 2008, 11:35:25 am
Thanks Dave, I've done that and all working so far  ;D
Is there an easy way to hide the advanced and search builder tabs in the interests of simplicity?
Thanks again for the help and advice.
Cheers
Matt
http://feedingmanchester.org.uk

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Hide field in default search (newbie)

This forum was archived on 2017-11-26.