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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • CiviCRM and Wordpress
Pages: [1]

Author Topic: CiviCRM and Wordpress  (Read 1286 times)

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
CiviCRM and Wordpress
October 02, 2012, 12:43:08 pm
I note that the pages created in CiviCRM default to the layout and structure of the "home page" of the WordPress Theme. So, for instance, if you create a contribution form in CiviCRM, the live page is rendered with the same page template as the home page of the site. Not good. It's probably okay for most users of the WP plugin but, some WP users have set different templates for different page types (blog posts, categories, archives, static pages, etc.). The page template is part of the WP theme (e.g. Pagelines Frameworks) and can be controlled by editing the page (typically with a drop down selector of different Templates).

How can I change the front end page template for a CiviCRM page, for instance a contribution form?  I do not want it to be the same as my home page, which is unique and not appropriate as a design for the form. Any ideas? How is the default, front-end page template assigned in CiviCRM installation of the WP plugin? Do I need to hack the code to change the default template? If so, how? Where is this code?
John Richardson

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: CiviCRM and Wordpress
October 02, 2012, 04:52:11 pm

Check this issue:

http://issues.civicrm.org/jira/browse/CRM-10682

4.2.2 has some support for this (via the settings files). Would be good to expose it via the UI so easier to change for folks etc

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

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
Re: CiviCRM and Wordpress
October 02, 2012, 06:20:27 pm
Thank you for this! It is exactly what I'm looking for. As discussed, the patch define( 'CIVICRM_UF_WP_BASEPAGE', 'about'); needs to be added, but where? I didn't quite understand that part of the discussion. Often, I can figure stuff out after a lot of trial and error. I'm not really a code warrior, so you'll have to be explicit. Where exactly do I add the bit of code? Thank you for your help!
John Richardson

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
Re: CiviCRM and Wordpress
October 02, 2012, 07:35:29 pm
Lobo,
I went into the civicrm.settings.php file and found the commented area for the patch. I made the change like so:

/**
 * For Wordpress users if your public pages are using a different template than the home page
 * you should set the name of the template with the below constant
 * This will be moved to a DB setting in 4.3, check CRM-10682
 */
// define( 'CIVICRM_UF_WP_BASEPAGE', 'about');

...putting in 'about' and saved the file. It didn't work. Did I do anything wrong? I also tried 'page' and 'Template 1'. The page does display properly when I add "about" to the url like this: http://www.lifechallengesemi.org/about/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=2

Any thoughts? Thank you!
John Richardson

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: CiviCRM and Wordpress
October 02, 2012, 08:09:29 pm

make sure u remove the two // at the start of the line, so PHP can interpret it

so it should be:

define( 'CIVICRM_UF_WP_BASEPAGE', 'about');

replace 'about' with the name of your template

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

John Richardson

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 0
    • Life Challenge of Southeastern Michigan
  • CiviCRM version: 4.5.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.27
  • PHP version: 5.3.13
Re: CiviCRM and Wordpress
October 02, 2012, 08:47:06 pm
Halleluja! Thank you. I am so happy!
John Richardson

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: CiviCRM and Wordpress
October 03, 2012, 07:25:00 am

Please pay it forward if you have the ability to do so :)

There is a wordpress MIH happening right now;

http://civicrm.org/content/make-it-happen#wpacl

which will benefit the civi-wp community significantly :)

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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • CiviCRM and Wordpress

This forum was archived on 2017-11-26.