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) »
  • Theming Contribution Page
Pages: [1]

Author Topic: Theming Contribution Page  (Read 2571 times)

Jerry

  • Guest
Theming Contribution Page
March 26, 2008, 08:18:01 am
Does anyone know how to apply a certain theme to different contribution pages on a Drupal install?  Essentially, we'll want to make it possible to have multiple themes for different contribution pages.

Thanks!
« Last Edit: March 26, 2008, 08:46:44 am by Jerry »

Jerry

  • Guest
Re: Theming Contribution Page
March 26, 2008, 08:46:11 am
http://drupal.org/project/taxonomy_theme

I have found this module and will testing to see if it works with contribution pages.

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: Theming Contribution Page
March 26, 2008, 10:59:26 am

In a prior project we had hacked page.tpl to switch to using a different page based on the url (q part). this allows you to use a different theme for all contribution pages. using a different theme per contribution page is a bit more difficult since the 'id' is stored in the session and not the url after the first page

i'll think a bit about it and post back if i get some ideas

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

Jerry

  • Guest
Re: Theming Contribution Page
March 28, 2008, 11:04:26 am
Quote from: Donald Lobo on March 26, 2008, 10:59:26 am

In a prior project we had hacked page.tpl to switch to using a different page based on the url (q part). this allows you to use a different theme for all contribution pages. using a different theme per contribution page is a bit more difficult since the 'id' is stored in the session and not the url after the first page

i'll think a bit about it and post back if i get some ideas

lobo


I look forward to anything you can assist with.  I will be testing out that module, but since the ID is stored in the session after the first page, I can see that it will not work.  We'll try looking into the page.tpl.

Thanks!

Jerry

  • Guest
Re: Theming Contribution Page
March 31, 2008, 08:42:57 pm
Quote from: Donald Lobo on March 26, 2008, 10:59:26 am

In a prior project we had hacked page.tpl to switch to using a different page based on the url (q part). this allows you to use a different theme for all contribution pages. using a different theme per contribution page is a bit more difficult since the 'id' is stored in the session and not the url after the first page

i'll think a bit about it and post back if i get some ideas

lobo


We'll, the module above will not (as expected) give us the results we were looking for.  Do you happen to know what type of hack achieved these results?

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: Theming Contribution Page
March 31, 2008, 09:16:14 pm

here's the url of what we hacked, which will not work for you (since part of the information is in the session)

http://svn.civicrm.org/quest/trunk/themes/quest/template.php

Your best bet might be to hack: CRM/Utils/System.php, function theme (line 140)

and invoke the "appropriate" theme handler for that page. The contribution page stores the contributionId of the page its processing at the top level, you can retrieve it by using

Code: [Select]
  $session =& CRM_Core_Session::singleton( );
  $contributionPageID = $session->get( 'pastContributionID' );

(pardon the wrongly named variable)
Based on the contributionPageID you can potentially switch to a specific theme. In CiviCRM's case, the $type in the theme function is always 'page'

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Theming Contribution Page

This forum was archived on 2017-11-26.