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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
Pages: [1]

Author Topic: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)  (Read 6573 times)

cameron

  • Guest
Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 21, 2009, 06:46:38 am
Hi,

Having read through various threads it seems the ability to list CiviCRM profiles in Drupal Profile pages is limited (i.e. to an individual not orgnaisation) and that it seems difficult to have various civicrm profile categories in different sections of a Drupal Profile page created with Panels.

As such I would like to explore how flexible a Profile page can be presented in a Drupal site if I use solely CiviCRM Profile fields. What I want is to be able to have a profile page of registered (and paid) users that displays contact details, location map, image gallery, business logo, profile header image and contact form. I also want unregistered users to be able to search registered users profiles via postcode/community and produce a list with name, logo image, teaser description and location that links to the users profile page.

Can someone please tell me how I am going to acheive this as I am at my whits ends researching both sites.

thanks heaps in advance!!

Cameron

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: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 21, 2009, 10:55:58 pm

I'm not sure i understand what you mean. CiviCRM profiles are not connected at all to Drupal profiles (they unfortunately share the same name!)

you might want to read about CiviCRM profiles a bit more in the book: http://en.flossmanuals.net/CiviCRM/CapturingExposing or on the wiki

no idea about panels integration, not used it as yet :(

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

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: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 22, 2009, 04:00:31 am
I think you may want to explore what can be done via Views - and then output this in a way that you can use in a pane in panels (blocks, content pane, page etc)
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

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 22, 2009, 04:17:28 am
Hi Peter, yes that is what I am wanting... thanks for framing it!

Thanks for your response Donald, the link I am speaking of is when in CiviCRm the profiles can be allowed to appear in the Drupal Profiles including registration. I have framed my question in this form as I know only this way of presenting the user information.

So, in conjunction with what Peter has mentioned which is the raw display of user data, I require a function using/or similar to the Drupal Profile that allows paid users to register to have a Profile page that they can change via text, image galleries, contact details etc, and can be searchable by unregistered users producing a list associated with postcode/community/suburb/city.

I hope I made my query a little clearer!

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: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 22, 2009, 06:48:40 am

i dont think i still understand it, but if peter's reply makes sense, then do use the views2 integration to expose contact details etc

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

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 23, 2009, 04:31:18 am
Hi Donald & Peter,

I have looked through the info regarding views2 integration - http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module and I am left not understanding the guide to setting up the drupal setting.php file to access civicrm categories... see comment below. ps i have separate db's for ccrm and drupal.

You will need to set database prefixes in your Drupal settings.php file so that Views2 can access your CiviCRM DB. The prefixes can be seen on a url like: http://drupal.demo.civicrm.org/civicrm/admin/setting/uf?reset=1. You will need to have Views2 enabled to see those settings. Important: You will have to update your settings.php with new prefixes every time you add new Custom Field Group.  Also, after making changes in civicrm you should clear Drupal's view cache at:  Administer › Site building › Views › Tools and press "Clear Views cache".

I do not understand what prefixes I am suppose to be seeing via the link profided (seeing as I cannot get into the demo sites settings.php file) and a don't understand how I am able to see these setting if I have Views2 enabled.

I am in my setting.php file and I can see the following section :

$db_url = 'mysqli://visionar_USERNAME:PASSWORD@localhost/visionar_DRUPALDATABASENAME';
$db_prefix = '';

My ccrm db is @ visionar_civicrm and uses the same username as the drupal db, with full permisions.

Can you please give me specific guidance as an example to give drupal view2 access to a ccrm profile category that I have named 'contact details' ???

thanks
Cameron
« Last Edit: July 23, 2009, 04:39:57 am by caminoz74 »

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules e
July 23, 2009, 04:52:36 am
Hi caminoz,

The page you require is located at: http://yoursite.com/civicrm/admin/setting/uf?reset=1

I can't copy and paste this information as its specific to your install of CiviCRM, however it will look something like this:

$db_prefix = array(
  'civicrm_acl'                              => 'your_database.',
  'civicrm_acl_cache'                        => 'your_database.',
  'civicrm_acl_entity_role'                  => 'your_database.',
);

etc... there are a lot of values.

Once you have found these, you need to copy them, and paste them into your drupal settings.php file. You can place them just below the line:

$db_prefix = '';

That you see (usually around line 93 depending on the settings you have).

Once you have done this, you should see a whole host of new options when you create a new view.

I hope this helps. All the best,

Adam

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 23, 2009, 05:23:37 am
Thanks for that... this is flipping fantastic... all works great!!! been plugging away at trying to do this for weeks!!!

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 23, 2009, 05:38:51 am
One little thing... not quite sure where I am missing it but when I display the view it lists multiple outputs of each of the two fields selected??? Any ideas where I missed something.


Full Street Address:
First Name:
Full Street Address: 52 Terania St
First Name: Cameron
Full Street Address:
First Name: Cameron

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
July 23, 2009, 03:32:27 pm
I just need to spend time figuring out the other settngs in views to limit display criteria to the user details (Drupal My Account view) .. all good, thanks for everyones help.
« Last Edit: July 23, 2009, 04:03:46 pm by caminoz74 »

cameron

  • Guest
Double User results in View???
July 27, 2009, 01:59:09 am
Hi,

I have tried everything I can possbily think of but I still get a double result from my view query. Please see details below?? I am hopeing it is something silly that i have missed???

I would so very much appreciate help.

Below is what comes out of the View in the Drupal Panel section (overriding core Drupal Profile). Please note that the 2nd entry is not displaying the address??. Also please note that the double entry first occurs when I add any of the location/address/Postal code fields to the view. i.e.This does not occur if I only list fields for Name and Phone (Primary). But it does occur if I try to add Phone (mobile) ???

View display -

Contact: Cameron
Phone: 026688XXXX
Address: 5X Terania St
Contact: Cameron
Phone: 026688XXXX
Address:

This is the query result in the View -

SELECT DISTINCT(civicrm_contact.id) AS id,
   users_civicrm_uf_match__civicrm_contact.last_name AS users_civicrm_uf_match__civicrm_contact_last_name,
   users_civicrm_uf_match__civicrm_contact.id AS users_civicrm_uf_match__civicrm_contact_id,
   civicrm_phone.phone AS civicrm_phone_phone,
   civicrm_address.street_address AS civicrm_address_street_address
 FROM visionar_civicrm.civicrm_contact civicrm_contact
 LEFT JOIN visionar_civicrm.civicrm_uf_match civicrm_uf_match ON civicrm_contact.id = civicrm_uf_match.contact_id
 LEFT JOIN users users_civicrm_uf_match ON civicrm_uf_match.uf_id = users_civicrm_uf_match.uid
 LEFT JOIN visionar_civicrm.civicrm_uf_match users_civicrm_uf_match__civicrm_uf_match ON users_civicrm_uf_match.uid = users_civicrm_uf_match__civicrm_uf_match.uf_id
 LEFT JOIN visionar_civicrm.civicrm_uf_match users_civicrm_uf_match_users_civicrm_uf_match__civicrm_uf_match ON users_civicrm_uf_match.uid = users_civicrm_uf_match_users_civicrm_uf_match__civicrm_uf_match.uf_id
 LEFT JOIN visionar_civicrm.civicrm_contact users_civicrm_uf_match__civicrm_contact ON users_civicrm_uf_match__civicrm_uf_match.contact_id = users_civicrm_uf_match__civicrm_contact.id
 LEFT JOIN visionar_civicrm.civicrm_phone civicrm_phone ON civicrm_contact.id = civicrm_phone.contact_id
 LEFT JOIN visionar_civicrm.civicrm_address civicrm_address ON civicrm_contact.id = civicrm_address.contact_id
 WHERE users_civicrm_uf_match__civicrm_contact.id = 1

And here is the entire exported View -

Code: [Select]
$view = new view;
$view->name = 'Contact_Details';
$view->description = 'Contact Details';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'civicrm_contact';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'drupal_id' => array(
    'label' => 'Drupal User',
    'required' => 0,
    'id' => 'drupal_id',
    'table' => 'civicrm_contact',
    'field' => 'drupal_id',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'last_name' => array(
    'label' => 'Contact',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_civicrm_contact' => 0,
    'exclude' => 0,
    'id' => 'last_name',
    'table' => 'civicrm_contact',
    'field' => 'last_name',
    'relationship' => 'drupal_id',
  ),
  'phone' => array(
    'label' => 'Phone',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'phone',
    'table' => 'civicrm_phone',
    'field' => 'phone',
    'relationship' => 'none',
  ),
  'street_address' => array(
    'label' => 'Address',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'street_address',
    'table' => 'civicrm_address',
    'field' => 'street_address',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'id' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'id',
    'table' => 'civicrm_contact',
    'field' => 'id',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
    ),
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'drupal_id',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'panel' => 0,
      'civicrmactivity' => 0,
      'page' => 0,
      'profile' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('distinct', 1);
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->override_option('pane_title', '');
$handler->override_option('pane_description', '');
$handler->override_option('pane_category', array(
  'name' => 'View panes',
  'weight' => 0,
));
$handler->override_option('allow', array(
  'use_pager' => FALSE,
  'items_per_page' => FALSE,
  'offset' => FALSE,
  'link_to_view' => FALSE,
  'more_link' => FALSE,
  'path_override' => FALSE,
  'title_override' => FALSE,
  'exposed_form' => FALSE,
));
$handler->override_option('argument_input', array(
  'uid' => array(
    'type' => 'panel',
    'context' => 'term.tid',
    'panel' => '0',
    'fixed' => '',
    'label' => 'User: Uid',
  ),
));
$handler->override_option('link_to_view', 0);
$handler->override_option('inherit_panels_path', 0);
« Last Edit: July 27, 2009, 03:34:36 pm by caminoz74 »

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
August 04, 2009, 10:35:03 am
Hey, I ran into this same issue with duplicate display.  Any time a contact has either:

1) more than one phone number at an address
2) more than one address

You will see duplicate results in the display.  This is very unfortunate, but underscores the shortcomings of the Views2 integration with CiviCRM.  A custom handler must be developed for some views, which is something I have researched extensively but still don't understand how to do myself.  I'm sorry I wish I could help you, but handlers must be edited/improved/added to file:

drupal/modules/views/civicrm.views.inc
Try CiviTeacher: the online video tutorial CiviCRM learning library.

cameron

  • Guest
Re: Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)
August 07, 2009, 05:07:55 pm
just to tie this in... I found that if i create a User type View rather than a CiviCRM view it matches up and not double entry. With that in mind entries to the civicrm/views sync need to made... thanks to Jim Taylor please also see this thread http://forum.civicrm.org/index.php/topic,9135.0.html

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Using CiviCRM Profiles with Drupal Panels (image galleries + other modules etc)

This forum was archived on 2017-11-26.