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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Event Reg page as Drupal front page?
Pages: [1]

Author Topic: Event Reg page as Drupal front page?  (Read 2076 times)

Thinkling

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
Event Reg page as Drupal front page?
March 29, 2008, 02:18:02 pm
I've got a Drupal 5.7 + CiviCRM 2.0.1 install.

I'd like the front page of the Drupal site to show the registration form for a specific event set up in CiviEvent. Drupal allows one to set the front page URL, so I've tried that directly as well as using a Drupal URL alias.

The URL I've used is:
civicrm/event/info?reset=1&id=1

Instead of going to the registration form, this goes to the CiviEvent overview page, i.e.
civicrm/event/info?reset=1

Then clicking on the event's link shows the registration page just fine.

I'd like it to go straight to the registration page. What am I missing?

Thanks!

PS: can the "Download iCalendar File" link be turned off? (or do I just hide it with some CSS? :)



Thinkling

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
Re: Event Reg page as Drupal front page?
March 29, 2008, 02:52:30 pm
Ah, someone reminded me that Drupal will munge the query string rather than pass it on. Using a RewriteRule in .htaccess solved this problem.

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: Event Reg page as Drupal front page?
March 29, 2008, 03:56:14 pm

Can u please cut-n-paste the ReWriteRule u used to solve this problem. I suspect it will help a few other folks too :)

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

Thinkling

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
Re: Event Reg page as Drupal front page?
March 29, 2008, 05:31:27 pm
Sure, this is the rewrite I added in drupal/.htaccess. I'm not an apache rewrite expert, so use these at your own risk. :-)

Code: [Select]
 
# forward certain URLs to a CiviCRM event registration form
# add these to the .htaccess file in Drupal's root directory, below
# the line "RewriteBase /" and above Drupal's lines that deal with
# index.php?q=
#
# NOTE: this assumes the event id is 1 (edit id=1 in each line below to change)

# forward mydomain.com/ and mydomain.com/index.php
  RewriteRule ^$ /civicrm/event/info?reset=1&id=1 [L]
  RewriteRule ^/index.php /civicrm/event/info?reset=1&id=1 [L]

# forward mydomain.com/eventname
  RewriteRule ^eventname /civicrm/event/info?reset=1&id=1 [L]

A curiosity question: why do normal civicrm URLs that have query string components work, but setting the Drupal front page to such a URL does not? I know Drupal is hostile to variables in the query_string other than ?q=, but they get passed through OK in the normal use of urls like mydomain.com/civicrm/info?reset=1&id=1. Doesn't that string get passed by Drupal to civicrm through a hook function?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event Reg page as Drupal front page?
March 29, 2008, 06:55:54 pm
Quote from: Thinkling on March 29, 2008, 02:18:02 pm
PS: can the "Download iCalendar File" link be turned off? (or do I just hide it with some CSS? :)

If you're ok removing the iCal links for all event info pages, best approach is to create a custom copy of the template used for that page (templates/CRM/Event/Page/Eventinfo.tpl) - and remove those links. Check out the instructions for customizing CiviCRM screens in the Develop section of the documentation.

RE: Drupal and query strings - I'm not an expert on this but in my experience the query strings aren't munged if you use a complete (i.e. not relative) URL. http://mysite.com/drupal/civicrm/event/info?reset=1&id=1 rather than civicrm/event/info?reset=1&id=1
Protect your investment in CiviCRM by  becoming a Member!

dredbird

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Re: Event Reg page as Drupal front page?
April 22, 2008, 08:41:50 am
Quote from: Dave Greenberg on March 29, 2008, 06:55:54 pm
RE: Drupal and query strings - I'm not an expert on this but in my experience the query strings aren't munged if you use a complete (i.e. not relative) URL. http://mysite.com/drupal/civicrm/event/info?reset=1&id=1 rather than civicrm/event/info?reset=1&id=1

I tried this but got a "Page not found" error.

However, the htaccess rewrite works perfectly.

(Drupal 5.7 and Civicrm 2.0.1)
My worst fear is that the rhythm really is going to get me.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Event Reg page as Drupal front page?

This forum was archived on 2017-11-26.