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 »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • Content Types & Custom Field Integration for WordPress
Pages: [1]

Author Topic: Content Types & Custom Field Integration for WordPress  (Read 3760 times)

Tadpole Collective

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
    • Tadpole Collective
  • CiviCRM version: Latest
  • CMS version: latest
Content Types & Custom Field Integration for WordPress
April 29, 2013, 06:59:47 pm
I'd like to get some feedback/ideas about the following. I have been thinking about how the features within CiviCRM can be displayed from WordPress, so how can petitions, profiles, surveys, listings and cotribution be displayed around WordPress, specifically around Post Types (http://codex.wordpress.org/Post_Types) and Custom Fields (http://codex.wordpress.org/Custom_Fields). In some ways, this would do something like Views.

My initial thought was just add Shortcodes so that a WordPress administrator can add CiviCRM features to any post type (which is still a good start). By doing this the admin can, for example, create a content type called petitions and then use a shortcode to add the petition they have created to a post type with WordPress. This would allow the user to determine the URL structure they desire and let the WP theme archive it too. It is relatively simple, however it would be a two step process. One in creating the feature within CiviCRM and the other to add the shortcode where it's wanted to be displayed within WP.

In WP there are quite a few plugins that allow you to create post-types and custom fields to use and can de added/displayed within your theme. In the past few months I've used this one: http://wordpress.org/extend/plugins/my-content-management/, since it has some commonly used post types (like People or FAQs) and it ties in custom fields nicely that can be customized for each content type. There are also quite a few things that can be done from within the WP Dashboard but it also allows templates to be added to the theme. I was wondering if we could use this structure to add CiviCRM post types that sync to features. So a post-type for Petitions, Surveys, Contributions, Profiles and Listings would be added. And then use the custom fields to bring in CiviCRM fields. I'm attaching a couple of screenshots for reference. Please let me know if this is a feasible option and how we could integrate CiviCRM API to accomplish this.

Thanks!

Dana

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Content Types & Custom Field Integration for WordPress
May 08, 2013, 08:04:14 pm
Let me see if I understand you correctly: You'd like the ability to sync certain types of Wordpress content with certain Civi entities. So after setting up the custom fields for your content type as shown in your images, this would enable a 2-way sync between the posts and entities? So if for example you linked Civi events with WP posts of type "event" then every time an event was created in Civi it would automatically create a post in wordpress and vice-versa?
I'm not familiar with how WP handles field storage, but it seems like it would be best if the data only existed in Civi and WP simply read from that database to get the field info rather than having to store it in both places and sync via hooks, etc. An (incomplete) attempt has been made to do this in Drupal as well.
Am I on the right track in trying to understand what you want?
Try asking your question on the new CiviCRM help site.

Tadpole Collective

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
    • Tadpole Collective
  • CiviCRM version: Latest
  • CMS version: latest
Re: Content Types & Custom Field Integration for WordPress
May 09, 2013, 03:05:11 pm
Yes Coleman, thanks for your response.

I hadn't specifically thought about events given the calendar aspect, but in theory this is true. It's essentially how do I get CiviCRM features and content to display on WordPress? But the data is in Civi already and goes to & from Civi. WP is used to organize the display of that content only. Meaning the website admin can control the URL of content or post type, organize around taxonomies, permissions of who sees it (from post type), layout/design, and archive pages. So it would look like this from the WP side in regards to Content Types sample URL structure with CiviCRM data:
  • mysite.org/mailings
  • mysite.org/petitions
  • mysite.org/petitions/petition-name
  • mysite.org/surveys
  • mysite.org/surveys/survey-name
  • mysite.org/grants
  • mysite.org/projects
  • mysite.org/events
Since Profiles tie into all of them, I am not sure how the best way to link that information is. If it's custom fields only, it's not actually creating a form, so it requires some thought. Which may be relevant for Grants & Cases (or projects) so that front/public custom dashboards could be created for website visitors, for example, to see updates during an application process and update their data as needed.

Let me know if that makes sense and is in line with what you are thinking and is possible.

Tadpole Collective

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
    • Tadpole Collective
  • CiviCRM version: Latest
  • CMS version: latest
Re: Content Types & Custom Field Integration for WordPress
May 10, 2013, 10:04:55 am
Wanted to note that for events we are working with developer of this plugin: http://wordpress.org/extend/plugins/every-calendar-1/, so add CiviEvent API integration to display on a calendar in WP. That allows for flexibility for existing Google Calendars to be brought in too and later on CalDav too.

Let me know if we can work with this developer for the events piece. He is open to working on this, but will need help with Civi related questions.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Content Types & Custom Field Integration for WordPress
May 10, 2013, 05:49:10 pm
OK I think my initial take on what you wanted to do was wrong. You're simply wanting more control over the path to civi content in wordpress.
Let's start with what's already possible:
- Shortcodes are nice but not necessary because...
- You can display a piece of Civi content on your site by linking to its url, e.g. http://example.org/?page=CiviCRM&q=civicrm/event/info&reset=1&id=1
- Currently this will use your sites homepage as the template (with civi's content substituted for the homepage content) although some work is being done to make this more flexible (not sure of the status of that project)
- You could put this link in your WP menu and for all practical purposes it would be like any other piece of content on your site, with the exception that you edit it through Civi and not through WP

So what about the above is not working or needs improvement?
Try asking your question on the new CiviCRM help site.

Tadpole Collective

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
    • Tadpole Collective
  • CiviCRM version: Latest
  • CMS version: latest
Re: Content Types & Custom Field Integration for WordPress
May 10, 2013, 08:15:18 pm
Thanks Coleman, I'm aware of the options that are currently available, which are great. The goal is really to make it a bit more automated (not needing double entry) and give the CMS a bit more control of display of this content. In a sense what is done with Views in Drupal and maybe a bit of webforms too. So it would be improvements to how a WP admin can display Civi data and the ability to create user/role based front-end dashboards. Does that make sense?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Content Types & Custom Field Integration for WordPress
May 10, 2013, 09:05:48 pm
Well, no it doesn't quite make sense. Views and Webforms are both huge integration projects and I think would be way outside the scope of this issue to replicate in WP. Also I don't think there's any equivalent to Views in WP (an uber-flexible query/display builder that is used on 90%+ of all Drupal sites). I could be wrong about those assertions though.
One point we need to clarify is whether you are talking about displaying Civi content as Wordpress content (potentially a very big undertaking ala Views) or as Civi content embedded in a WP page.
Try asking your question on the new CiviCRM help site.

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: Content Types & Custom Field Integration for WordPress
May 10, 2013, 09:26:36 pm

i suspect an IRC conversation on this will be a lot more efficient and fruitful

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

Tadpole Collective

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
    • Tadpole Collective
  • CiviCRM version: Latest
  • CMS version: latest
Re: Content Types & Custom Field Integration for WordPress
May 11, 2013, 07:58:39 am
True, an IRC chat is likely best. I can schedule a time for Monday if that works. I'll be online this weekend, but if we want to plan a time, Monday is best.

I am thinking something simpler but I wanted to convey the a sense of deeper integration. I see it like using what the shortcodes already offer, but linking it automatically to a post type so that it gets published and displayed automatically in that post type archive when created in CiviCRM. So for example, in adding the CiviEvent API to the WP event calendar shared above, anytime an event is published in CiviCRM it gets posted as an event post-type on WordPress and vice-versa. Right now there are shortcodes for events, contribution pages, profiles and user dashboard. Is it possible to extend to petitions and surveys? For Cases & Grants it's more a progress dashboard that is shared with ways to display data and ask for new if needed.

The reason I shared the specific My Content Management post-type creator plugin is because it has a few default post-types that an admin can enable with a check-box and assign custom fields to it. Additionally it provides a space for admins to customize the layout of that post-type layout with field IDs and a little html, giving folks the ability to customize a bit without knowing CSS or PHP. So using this as a model, and building on shortcodes, it would be creating a CiviCRM Post-Type plugin that lists available post-types to enable and display in WP. It seems to be simliar to providing shortcodes with a bit more direction/control on content layout, if I am understanding how the shortcodes are placed correctly.

We would like to use the project we are working on now to develop this, or something like this if possible. However, I should note the specific initial needs are a way to use petitions or campaigns to allow constituents to email their local legislators and archive history for reporting in Civi (which may just be a profile per legislator) and frontend dashboard for both cases and grant applicants to see progress and submit updates. I can provide more detail as needed, but am hoping we can use the needs of this project to create a couple more tools that integrate WP to Civi more seamlessly for the community to use.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Content Types & Custom Field Integration for WordPress
May 11, 2013, 05:36:38 pm
OK cool, that gives me some more clarity. Sounds like a great project, with lots of possibilities. Let's chat on the IRC Monday.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • Content Types & Custom Field Integration for WordPress

This forum was archived on 2017-11-26.