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 Profiles (Moderator: Dave Greenberg) »
  • Profile search form placing in content/module
Pages: [1]

Author Topic: Profile search form placing in content/module  (Read 1390 times)

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Profile search form placing in content/module
August 21, 2011, 03:37:52 am
Hi Friends,

After a 3 days googling and wandering around web for this solution I am at last here. Please Help. The Problem is very simple I want to show the search form of one of my civicrm profile which add and fetch data from a specific group to be displayed in content instead of making a "Profile search" menu. Why I want to do this is because I want to display the search form in a content when the site loads instead of clicking on search form menu to access the form??

I know how to place HTNL and Js in content or in module positions in Joomla so Is there any way to have the html/Js of the search form so that I can place it in the content?? or is there any other way to display form in content or module?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profile search form placing in content/module
August 26, 2011, 12:50:24 am
Not quite sure what you're trying to do  ???
IF you just want the profile search form to be the front page of the front-end of your site, you can probably do this by creating a menu item for the profile search form (J Menu Mgr) and then configuring that item to be the home page.

IF you want to embed the search form within some other content on the front page, you can TRY copying / pasting the HTML of the form and embedding it with your other content in a regular content page. I'm not sure this will work, but I think it might. You'll still need to create a front-end menu item for the profile, view source, copy the search form section and paste to your content. I would expect that clicking Search should then POST to / redirect to that page for the search results. (Have not tried this myself.)

Protect your investment in CiviCRM by  becoming a Member!

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Re: Profile search form placing in content/module
August 28, 2011, 05:38:34 am
Adding the source code in the content worked! Thanks.
But I have one more problem left. That is, I want that each time someone search for a specific blood group in a specific city, the listing should be random. Because the problem is if a person search for a specific blood group in a city if every tme same list order opens people often contact the same persons for blood donation request, but if the listing/search results would be random each time than there will be more probability that a new person will be contacted. So how can I achieve this that every time a person search the search results should be displayed randomly not in alphabetic or date order. how can I do this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profile search form placing in content/module
August 28, 2011, 06:58:36 am
Sorry, I don't know how this could be done, but pretty sure you'll need someone w/ developer skills to get in a figure it out because it can not be done "out of the box" as far as I know.
Protect your investment in CiviCRM by  becoming a Member!

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Re: Profile search form placing in content/module
August 29, 2011, 11:02:26 am
Ok :(

But Dave there is one another problem still there . It is related to my first question i.e. how to place search form in the content. The problem is when I copy the form code from the browser source code and paste it in the content, the form works very wel for 2-3 three times and after that it gives this error

"Sorry. A non-recoverable error has occurred.
The requested Profile (gid=3) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance."

I am wondering that how the form works for 2-3 times and then automatically stops working? And If I copy and paste fresh code then it again works for 2-3 times and again gives same error. I tried different browsers and also by emtying cache/colies etc.

Please help Dave.

The source code I am pasting in my content to show the form is :

Code: [Select]
<table id="crm-content" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<div id="printer-friendly">&nbsp;</div>
<form id="Search" action="http://blooddonor4u.com/index.php?option=com_civicrm&amp;task=civicrm/profile&amp;Itemid=78" method="post">
<div><input type="hidden" name="qfKey" value="d254752b95fd6d49c204384242f9b577_9350" /> <input type="hidden" name="_qf_default" value="Search:refresh" /></div>
<div class="crm-block crm-form-block">
<div class="crm-accordion-wrapper crm-group-10-accordion crm-accordion-open">
<div class="crm-accordion-body">
<table id="profile" class="form-layout-compressed" border="0">
<tbody>
<tr>
<td class="label"><label for="custom_1">Blood Group</label></td>
<td class="description"><select id="custom_1" class="form-select" name="custom_1"> <option>- select -</option> <option value="A+">A+</option> <option value="A-">A-</option> <option value="B+">B+</option> <option value="B-">B-</option> <option value="O+">O+</option> <option value="O-">O-</option> <option value="AB+">AB+</option> <option value="AB-">AB-</option> </select></td>
</tr>
<tr>
<td class="label"><label for="custom_2">City</label></td>
<td class="description"><select id="custom_2" class="form-select" name="custom_2"> <option>- select -</option> <option value="Lahore">Lahore</option> <option value="Islamabad">Islamabad</option> <option value="Karachi">Karachi</option> <option value="Sheikhupura">Sheikhupura</option> <option value="D.G.Khan">D.G.Khan</option> <option value="Dera Bugti">Dera Bugti</option> <option value="Gwadar">Gwadar</option> <option value="Kalat">Kalat</option> <option value="Kanpur">Kanpur</option> <option value="Lasbela">Lasbela</option> <option value="Quetta">Quetta</option> <option value="Sibi">Sibi</option> <option value="Sui">Sui</option> <option value="Surab">Surab</option> <option value="Hunza">Hunza</option> <option value="Gilgit">Gilgit</option> <option value="Skardu">Skardu</option> <option value="Malakand">Malakand</option> <option value="Khyber">Khyber</option> <option value="Waziristan">Waziristan</option> <option value="Abbottabad">Abbottabad</option> <option value="Ayubia">Ayubia</option> <option value="Bannu">Bannu</option> <option value="Charsadda">Charsadda</option> <option value="Chitral">Chitral</option> <option value="D I Khan">D I Khan</option> <option value="Kalam">Kalam</option> <option value="Khanaspur">Khanaspur</option> <option value="Kohat">Kohat</option> <option value="Kohistan">Kohistan</option> <option value="Lakki Marwat">Lakki Marwat</option> <option value="Dir">Dir</option> <option value="Mansehra">Mansehra</option> <option value="Mardan">Mardan</option> <option value="Mongora">Mongora</option> <option value="Nowshera">Nowshera</option> <option value="Peshawar">Peshawar</option> <option value="Swabi">Swabi</option> <option value="Swat">Swat</option> <option value="Thall">Thall</option> <option value="Ahmed Nager">Ahmed Nager</option> <option value="Arifwala">Arifwala</option> <option value="Bhalwal">Bhalwal</option> <option value="Bahawalnagar">Bahawalnagar</option> <option value="Bahawalpur">Bahawalpur</option> <option value="Bhaipheru">Bhaipheru</option> <option value="Bhakkar">Bhakkar</option> <option value="Burewala">Burewala</option> <option value="Chakwal">Chakwal</option> <option value="Chichawatni">Chichawatni</option> <option value="Chiniot">Chiniot</option> <option value="Daska">Daska</option> <option value="Faisalabad">Faisalabad</option> <option value="Gujranwala">Gujranwala</option> <option value="Gujrat">Gujrat</option> <option value="Hafizabad">Hafizabad</option> <option value="Haroonabad">Haroonabad</option> <option value="Haveli Lakha">Haveli Lakha</option> <option value="Jampur">Jampur</option> <option value="Jhang">Jhang</option> <option value="Jhelum">Jhelum</option> <option value="Kalabagh">Kalabagh</option> <option value="Kasur">Kasur</option> <option value="Kamalia">Kamalia</option> <option value="Kamokey">Kamokey</option> <option value="Khanewal">Khanewal</option> <option value="Khanpur">Khanpur</option> <option value="Kharian">Kharian</option> <option value="Khushab">Khushab</option> <option value="Kot Addu">Kot Addu</option> <option value="Jahania">Jahania</option> <option value="Jauharabad">Jauharabad</option> <option value="Layyah">Layyah</option> <option value="Mandi Bahauddin">Mandi Bahauddin</option> <option value="Mian Channu">Mian Channu</option> <option value="Mianwali">Mianwali</option> <option value="Multan">Multan</option> <option value="Murree">Murree</option> <option value="Muridke">Muridke</option> <option value="Muzaffargarh">Muzaffargarh</option> <option value="Narowal">Narowal</option> <option value="Okara">Okara</option> <option value="Rajan Pur">Rajan Pur</option> <option value="Pak Pattan">Pak Pattan</option> <option value="Pattoki">Pattoki</option> <option value="Rabwah">Rabwah</option> <option value="Raiwind">Raiwind</option> <option value="Rahim Yar Khan">Rahim Yar Khan</option> <option value="Rawalpindi">Rawalpindi</option> <option value="Rohri">Rohri</option> <option value="Sadiqabad">Sadiqabad</option> <option value="Sahiwal">Sahiwal</option> <option value="Sargodha">Sargodha</option> <option value="Shakargarh">Shakargarh</option> <option value="Sialkot">Sialkot</option> <option value="Tarbela">Tarbela</option> <option value="Taxila">Taxila</option> <option value="Toba Tek Singh">Toba Tek Singh</option> <option value="Vehari">Vehari</option> <option value="Wah Cantt.">Wah Cantt.</option> <option value="Wazirabad">Wazirabad</option> <option value="Baden">Baden</option> <option value="Ghotki">Ghotki</option> <option value="Hyderabad">Hyderabad</option> <option value="Jacobabad">Jacobabad</option> <option value="Jamshoro">Jamshoro</option> <option value="Jati">Jati</option> <option value="Khairpur">Khairpur</option> <option value="Kotri">Kotri</option> <option value="Larkana">Larkana</option> <option value="Mirpur Khas">Mirpur Khas</option> <option value="Naushara">Naushara</option> <option value="Nawabshah">Nawabshah</option> <option value="Nazimabad">Nazimabad</option> <option value="Shikarpur">Shikarpur</option> <option value="Thatta">Thatta</option> </select></td>
</tr>
<tr>
<td></td>
<td><span class="crm-button crm-button-type-refresh crm-button_qf_Search_refresh"><input id="_qf_Search_refresh" class="form-submit default" type="submit" name="_qf_Search_refresh" value="Search" /></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</form></td>
</tr>
</tbody>
</table>
<p>If the above search won't work and give an error than please click on the "Search Blood" menu on the left hand side under "Search and Donate Blood"</p>

sergeich

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • USDLC
Re: Profile search form placing in content/module
September 01, 2011, 06:48:45 am
Hi, I'm working on a solution for a similar task. It worked a few times however when I started analyzing the code and removed any session specific things like that hidden line in yours: "name="qfKey" value="d254752b95fd6d49c204384242f9b577_9350" - I started getting "You do not have permission to execute this url." So, copy/paste approach also didn't work in our case.

sergeich

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • USDLC
Re: Profile search form placing in content/module
September 01, 2011, 07:03:51 am
Mjawadsheikh,

I replicated the same exact problem as you described. In my case it the form stopped working as soon as I removed the hidden qfKey variable.

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Re: Profile search form placing in content/module
September 03, 2011, 01:49:56 am
Hi Sergiech, removing "name="qfKey" value="d254752b95fd6d49c204384242f9b577_9350" still giving the same previous error. An clue?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profile search form placing in content/module
September 05, 2011, 11:15:52 am
Quote from: sergeich on September 01, 2011, 07:03:51 am
Mjawadsheikh,

I replicated the same exact problem as you described. In my case it the form stopped working as soon as I removed the hidden qfKey variable.

Sergeich - have you verified that the anonymous role has the appropriate permissions for CiviCRM Profiles. If you're using Drupal or Joomla 1.6 / 1.7 - you do need to explicitly grant those permissions.
Protect your investment in CiviCRM by  becoming a Member!

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Re: Profile search form placing in content/module
September 05, 2011, 12:53:52 pm
Hi Dave,

I am using Joomla 1.5. Can you please figure out some solution for me also, that the form keeps working forever instead of working 2,3 times? Removing what sergiech said, haven't resolved the problem ,same problem, same error is there.

Please help.

Thanks a lot for suggestion Sergiech btw :)

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: Profile search form placing in content/module
September 05, 2011, 03:58:58 pm

i think the standalone profile form was designed only for the create form: civicrm/profile/create

I dont think we've ever tested it with the search form

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

mjawadsheikh

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 3.4.5
  • CMS version: Joomla 1.5
  • MySQL version: 5.0.92-community-log
  • PHP version: 5.2.17
Re: Profile search form placing in content/module
September 05, 2011, 08:29:12 pm
@Lobo

Thanks Lobo But is there any other way to place search form in an article or content ??or any solution to the problem that copy/pasted source code search form when placed in content stops working after 2-3 times use?


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: Profile search form placing in content/module
September 06, 2011, 07:12:53 am

sorry, not sure whats involved with getting the search field to be independent and put in an article. You'll need to debug and figure out why it works first and then stops working

if using drupal, you can potentially use the views integration to do the needful

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Profile search form placing in content/module

This forum was archived on 2017-11-26.