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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • URL aliases and CiviCRM forms
Pages: [1]

Author Topic: URL aliases and CiviCRM forms  (Read 2054 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
URL aliases and CiviCRM forms
August 05, 2008, 05:34:33 am
We're keen to embed some CiviCRM forms (contribution and profile forms) in templates.

URL aliases in our current setup don't support this (attempting to create a Drupal URL alias for civicrm/contribute/transact?reset=1&id=7 or civicrm/contribute/transact&reset=1&id=7) will result in the user being served the CiviContribute dashboard page (or access denied if appropriate).

I'd like to identify the correct method to generate the first page of the CiviContribute form (or a registration profile) and output the HTML, so then I can use that code in a Drupal template. I was expecting to find a function which accepts some arguments (eg the ID of the Contribute page) and outputs the form HTML, but I haven't located it yet.

Also keen to experiment with embedding more than one form on a page, though Lobo has warned me we'll probably face session conflict issues if we generate the first page of several multistep QuickForm pages ... but I gotta try!

Any thoughts / experience welcome on this one

Cheers
@xurizaemon ● www.fuzion.co.nz

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: URL aliases and CiviCRM forms
August 13, 2008, 09:37:11 pm
Here's a "poor mans" CiviCRM alias:

Create a Page with the path alias you want to use. Set the input format to accept PHP. Set the body as something like:

Code: [Select]
<?php
drupal_goto
('civicrm/profile/create', 'reset=1&gid=3');
?>


With the use of the arg() function, you can get real tricky and even feed variables to civicrm.
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • URL aliases and CiviCRM forms

This forum was archived on 2017-11-26.