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 do I modify the search criteria form
Pages: [1]

Author Topic: How do I modify the search criteria form  (Read 1849 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
How do I modify the search criteria form
June 25, 2008, 08:01:20 am
Hi, I have a drupal site containing a simply directory with 2 distinct groupings. My problem is that the tags for one group do not apply to the second group and vice versa. What I would like to do is to have 2 search boxes on the search page, one which searches one group and one the other, with indicative headings. I'm just not sure where to begin looking for at the php code that needs modifying (or if this is even necessary). Has anyone done anything similar or could give some indication what files I need to be looking at?
Many thanks
Matt
http://feedingmanchester.org.uk

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: How do I modify the search criteria form
June 25, 2008, 12:37:56 pm
hey matt

i don't think i understand what you want to do (or else i don't understand why you want to do it). are you saying you have tags that are mapping to each particular group (smart groups)? yet you want to separate out these different tags on the advanced search form? can you explain more clearly?

here is how i read what you said using an example:
so if you have two different groups, let's say 'doctors' and 'teachers'. then you have a bunch of tags 'pediatrician', 'surgeon', 'physical therapist', 'english', 'math', 'science'. the tags 'pediatrician', 'surgeon', and physical therapist' are a smart group and all map to the 'doctor' group. and the teaching tags map to the teacher group.

it sounds like you want to have a separate box for 'english', 'math', 'science' and another for 'pediatrician', etc. or that you have a box with 'doctors' group and then under it are the doctor tags, and a box for the 'teachers' group and under it are the teachers tags??

doing it the built-in way, all the tags are listed in the normal tags box on advanced search, and the two groups are in the groups box. i can search on any tag/group i want and it will only return the results associated with it. so in terms of technical reasons, i don't see why you need to separate them.

but if you are saying you want to separate out the groups/tags for some user-based reason, then you would most likely need to copy and modify Basic.tpl into your custom civicrm templates directory. You will need to rework the

Code: [Select]
<tr>
            <td><label>{ts}Contact Type(s){/ts}</label><br />
                {$form.contact_type.html}
            </td>
            <td><label>{ts}Group(s){/ts}</label><br />
                <div class="listing-box">
                    {foreach from=$form.group item="group_val"}
                    <div class="{cycle values="odd-row,even-row"}">
                    {$group_val.html}
                    </div>
                    {/foreach}
                </div>
            </td>
            <td colspan="2"><label>{ts}Tag(s){/ts}</label><br />
                <div class="listing-box">
                    {foreach from=$form.tag item="tag_val"}
                    <div class="{cycle values="odd-row,even-row"}">
                    {$tag_val.html}
                    </div>
                    {/foreach}
                </div>
            </td>
    </tr>
code to pull out what you want separated (again, i don't know if i understand your post).

The Basic.tpl file lives in CiviCRM at templates/CRM/Contact/Form/Search/Criteria. To see how to correctly do this type of thing go here: http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: How do I modify the search criteria form
June 25, 2008, 12:39:25 pm
i am also confused because you've put this post in using civimail, but it *sounds like* you are talking about the advanced search form, which is a core civicrm function that doesn't have anything to do with civimail.......

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How do I modify the search criteria form

This forum was archived on 2017-11-26.