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 (Moderator: Dave Greenberg) »
  • Pragmatically Create Node via CiviCRM Organization Contact
Pages: [1]

Author Topic: Pragmatically Create Node via CiviCRM Organization Contact  (Read 1514 times)

KamesCG

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Pragmatically Create Node via CiviCRM Organization Contact
January 31, 2015, 05:42:52 pm
I am wondering about the possibility of creating Nodes/Entities from CiviCRM Contacts and the required modules to complete the job.

Every major Organization in the CiviCRM back-office is going to be represented also in the Drupal front-end via custom content types labeled  "Merchant" with roughly 20 fields to manage biographies, product listings, galleries, contact information, etc...

My goal, instead of managing the creation the of every node page, would be to generate a node from information collected using the Webform CiviCRM module, that relies heavily on 5 different Contact Types, Custom Field-Sets and Profiles setups.

My first thought was to create a Feeds Import and a custom Views to generate the fields for a QueryPath or XParser Node Processor.

In other words, generate the content fields I need in Views, scape my own website using Feeds Node Processor and grant access to each node based off the Constituent Membership type and permissions.

Since I am new to CiviCRM I wanted to see if anyone else had any recommendations for completing this task, before I embarked on what is a possibly futile journey.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Pragmatically Create Node via CiviCRM Organization Contact
February 01, 2015, 03:18:29 am
Why do you feel you need to create a node for each Contact? You can use Contacts as entities within Drupal:

https://www.drupal.org/project/civicrm_entity
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

KamesCG

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Pragmatically Create Node via CiviCRM Organization Contact
February 01, 2015, 12:22:41 pm
Why do I feel the need to create a node for each contact? Hmm... Interesting question I suppose.

I guess I really don't "feel" like I need to create node. The situation kind of demands I have to create a Node, because I am not representing just contact information and addresses. The CiviCRM entity module states "This module provides CiviCRM entities (contacts, addresses, phones) as Drupal entities, to allow
rules integration, entity references, node to civi-views etc." which is great if that's what you are doing, but like I said I have to manage product listings, galleries and also help implement search engine optimization on a page-by-page basis.

Also, Nodes will be created for Organizations who sometimes may or not be in the CiviCRM system, so I can't rely specifically on CiviCRM to handle the creation of pages.

I super appreciate the module link though - it's probably a great reference for integrating Entities and CiviCRM.

--Additional Comment --

In short I need the Drupal Content Management "part" and the CiviCRM Contact list to play nicely, communicate when they have to, but for the most part stay independent as much as possible. I think adding dependencies early on will limit what I can do in both Drupal and CiviCRM. Maybe I am wrong though... and this is the exact module I am looking for.
« Last Edit: February 01, 2015, 12:49:03 pm by KamesCG »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Pragmatically Create Node via CiviCRM Organization Contact
February 02, 2015, 02:24:39 am
Quote from: KamesCG on February 01, 2015, 12:22:41 pm
I have to manage product listings, galleries and also help implement search engine optimization on a page-by-page basis.

Why does this require creating a node? I don't follow.

Quote from: KamesCG on February 01, 2015, 12:22:41 pm
Also, Nodes will be created for Organizations who sometimes may or not be in the CiviCRM system, so I can't rely specifically on CiviCRM to handle the creation of pages.

Is there a reason why you can't just create them in CiviCRM and mark them as being different somehow, like with a tag or some such?

Quote from: KamesCG on February 01, 2015, 12:22:41 pm
In short I need the Drupal Content Management "part" and the CiviCRM Contact list to play nicely, communicate when they have to, but for the most part stay independent as much as possible. I think adding dependencies early on will limit what I can do in both Drupal and CiviCRM. Maybe I am wrong though... and this is the exact module I am looking for.

The reason I encourage you not to duplicate data is because it's generally not advisable. You need not just a way to create a node for each new contact but also a way to maintain deleted nodes/contacts or edited nodes/contacts so that your two databases remain linked correctly always.

Regarding your initial issues of product listings, galleries and SEO, you might be better off doing this other ways, like with a custom module. It all depends on your precise needs which are not yet clear.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

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: Pragmatically Create Node via CiviCRM Organization Contact
February 02, 2015, 11:52:10 am
We have had situations where we need a node for each org - such as the Global Greens or European Greens where we have each party in civi and use a civi reference field to link it to the drupal node.

Then we can pull in civi data to the Party page, but also pull on to the party page related News items that have been 'node referenced' back to the Party page.

But we haven't needed to create nodes programatically as there was a limited number. Let us know how you get on though. It may be easier to create the civi contact after you create the node, using Rules and the civi entities code.
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

KamesCG

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Pragmatically Create Node via CiviCRM Organization Contact
February 02, 2015, 02:07:32 pm
The objective, which may be a long-shot, is to help 250+ merchants start publishing content on a Drupal Panopoly distribution package.

Creating the single-node is the just the beginning...

The Agricultural Institute of Marin manages 7 of the larger Farmers Markets in the Bay Area and I'm the CiviCRM/Drupal volunteer helping them develop a scalable content publishing platform for Farmers, Ranchers, Fisheries and Food Purveyors to better communicate with the people who buy/sell/consume the produce, meat and dairy.

It's a mixture of the Media module and Inline Entity references in a single content type "Merchant". I chose this route, so new users would not be overwhelmed by Drupal, but would also still be able to effectively manage a video gallery, product listings, additional retail locations, and other important information from a single node.

Merchant will be provided the ability to edit the Node via SimpleNodeAccess.

1 URL. 1 Edit Privilege. 1 User. 1 Save.

I want to make it also super accessible by phone, so recording a video, publishing it to YouTube and adding it to the website should only 15-20 take minutes max. It was hard enough to structure a flexible system, while still letting the very average user still participate in the content creation process.

TLDR: I need to introduce Organization Contacts to the idea of publishing and maintaining content.

---Additional Comment/Edit ---

Also, I am using the Finder module to provide ajax search for merchants and products, so I didn't even want to begin and try and get that working with CiviCRM...




« Last Edit: February 02, 2015, 02:24:45 pm by KamesCG »

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Pragmatically Create Node via CiviCRM Organization Contact
April 15, 2015, 05:41:46 pm
Sorry I missed this subject a month ago when it was hot but I'd like to weigh in a little on the site building aspect of your project.

I would suggest that rather than create a node for each merchant, that you instead build super custom Drupal User Profiles which you decorate with CiviCRM Contact Record data. I wrote a little bit about doing just that on the Drupal site (https://www.drupal.org/node/2234823).

Then I would suggest you grant the "merchant" role the ability to create and publish their own content. You can use Workflow or one of the other modules to help deal with the amount of content, how to aggregate it and where to publish it. You can use Views to create listings of the content these users create right on their user profile page and ad as many fields as you'd like via CiviCRM profile fields.

It'll give you the best of both worlds; a powerful contact management system ties to a powerful content creating system.
My CiviCRM Extension Workshop: https://github.com/awasson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Pragmatically Create Node via CiviCRM Organization Contact

This forum was archived on 2017-11-26.