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 CiviContribute (Moderator: Donald Lobo) »
  • Embed a contribution form within a Drupal page, e.g. as a block.
Pages: [1]

Author Topic: Embed a contribution form within a Drupal page, e.g. as a block.  (Read 764 times)

donquixote

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
  • CiviCRM version: none
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Embed a contribution form within a Drupal page, e.g. as a block.
February 11, 2014, 10:01:03 pm
I would like to create a page (in Drupal) that contains some "content" stuff (preferably managed by Drupal) and a CiviCRM contribution form.
It seems nicer for a CMS user if the page is a Drupal page node with Civi stuff embedded, instead of a Civi page with Drupal stuff embedded.

Lobo mentioned on irc this might be possible, but not recommended.

All I need to know is, given a contribution page id, how I can ask Civi (in code) to render the form as a block, as opposed to a full page.
And then, where the caveat is at, what could go wrong. Maybe the submit will have a problem?

I am willing to publish my solution on github or drupal.org, if I manage to make it work.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Embed a contribution form within a Drupal page, e.g. as a block.
February 11, 2014, 11:47:01 pm
why does it seems nicer to you?

building a contribute page is already about assembling lots of smaller bits (profile, price set...) adding one extra small bit coming from drupal would seem rather natural.

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Embed a contribution form within a Drupal page, e.g. as a block.
February 12, 2014, 11:22:48 am
Have you looked at webform_civicrm integration? That module can do exactly that - embed a contribution form within a drupal form. And you can stick it in a block if you want.
Try asking your question on the new CiviCRM help site.

donquixote

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
  • CiviCRM version: none
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Re: Embed a contribution form within a Drupal page, e.g. as a block.
February 25, 2014, 05:05:14 am
@Coleman: Thanks! Have not looked into it yet, but will (probably).

Some interesting stuff to look at:
https://drupal.org/project/civicrm_reference_fields a Drupal module to define a field to reference CiviCRM stuff.
https://drupal.org/node/1690118 suggests to introduce a formatter for this field that would embed the form.

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: Embed a contribution form within a Drupal page, e.g. as a block.
February 25, 2014, 10:16:31 am
coleman - isn't that option still limited to payment processors that occur on the civi page rather than those that handle it off-site?
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

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Embed a contribution form within a Drupal page, e.g. as a block.
February 25, 2014, 10:31:50 am
Yes that's true.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Embed a contribution form within a Drupal page, e.g. as a block.

This forum was archived on 2017-11-26.