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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to amend the Advanced Search form
Pages: [1]

Author Topic: How to amend the Advanced Search form  (Read 728 times)

michaellenahan

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
    • mick.appspot.com
How to amend the Advanced Search form
June 22, 2011, 11:27:14 am
Hello there,

Using version 3.4.3 on Drupal 6.

I'd like to amend the Advanced Search form, hiding options which are not used.

I'm looking for a .tpl file to amend and saw this in the page source:
<!-- .tpl file invoked: CRM/Contact/Form/Search/Advanced.tpl. Call via form.tpl if we have a form in the page. -->

- but taking a look on my server here:

sites/all/modules/civicrm/CRM/Contact/Form/Search

I can't see Advanced.tpl, just Advanced.php

I'm looking to either: just hide some bits by taking the html out of the template, or, preferably, put some jQuery which hides the bits I want to dynamically.

I'm probably missing something obvious - I'd be grateful for any pointers which will get me get going.

Thanks

Michael




Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to amend the Advanced Search form
June 22, 2011, 02:50:36 pm

check:

sites/all/modules/civicrm/templates/CRM/Contact/Form/Search/Advanced.tpl

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

michaellenahan

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
    • mick.appspot.com
Re: How to amend the Advanced Search form
June 23, 2011, 02:31:22 pm
Thanks Lobo - I have copied the Advanced.tpl into my CiviCRM custom templates directory and can now amend it.

Thanks to http://forum.civicrm.org/index.php/topic,20446.0/topicseen.html and http://civicrm.org/blogs/hershel/how-customize-civicrm-pages-jquery I know I can hide elements in the form using jQuery.

In my custom Advanced.tpl for example, I can now hide some of the accordions like this:

<script type="text/javascript">
cj(function() {
    cj().crmaccordions();
    /*
     *
     */
    cj('.crm-CiviEvent-accordion').hide( );
    /*
     *
     */


Just stepping back a little, the real reason why I'm doing this is that my client has asked for a simple form which just has:

Name or Email Search
... plus ...
Search on a set of custom fields we have set up.

The Advanced Search page already meets my needs as long as I can hide the unwanted elements.

The client is very keen on a simple interface which doesn't confuse users with too many options.

My question comes from the feeling that over-riding the Advanced Search doesn't make the system very future proof.

Is there a way I can create a "new" search template with just the bits I need.

I'm trying to avoid going down the "create a custom search" route if I can - this seems time-consuming - I'd prefer if possible to re-use what's already there.

Thanks for your thoughts.

Michael

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: How to amend the Advanced Search form
June 23, 2011, 05:49:35 pm
michael - do you know you can just remove accordians in one of the general settings?

civicrm/admin/setting/preferences/display?reset=1

not your whole answer i know
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

michaellenahan

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
    • mick.appspot.com
Re: How to amend the Advanced Search form
June 24, 2011, 02:12:21 pm
Thanks Peter - I didn't know that - I'm a bit embarrassed that I missed it but glad you pointed it out!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to amend the Advanced Search form

This forum was archived on 2017-11-26.