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) »
  • WordPress frontend pages
Pages: [1]

Author Topic: WordPress frontend pages  (Read 3643 times)

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
WordPress frontend pages
January 14, 2014, 01:15:22 pm
I am dealing with the issue that is discussed here: http://issues.civicrm.org/jira/browse/CRM-10682 but I am finding myself unable to solve it.

I created a new page, to use as the template: http://phdeviate.com/civicrm and I added to the civicrm.setting.php the line:
define( 'CIVICRM_UF_WP_BASEPAGE', 'civicrm');

(I pasted it just below the BASEURL, so that section now looks like this:

define( 'CIVICRM_UF_BASEURL'      , 'http://phdeviate.com/' );
define( 'CIVICRM_UF_WP_BASEPAGE', 'civicrm');

Yet, my tokens still don't go to a page that is useful, but rather to my home page. I suspect the reason that the home page doesn't work is that it's a funky one, using the "static home page" option from wordpress and all the "content" generated there is actually widgets, not "content" in the usual WordPress sense of that term.

I am also not sure if this other trouble is related: I can't get frontend form profiles to work EXCEPT by using the shortcode to generate the profile. That's what I did here: http://phdeviate.com/phdlist/ but when I try to access that same profile by the "Use/Profile Create Mode" I get a page that cannot be accessed by anyone not already logged in: http://phdeviate.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/profile/create&gid=13&reset=1

When I delete the "wp-admin/admin.php? as I saw recommended here: http://forum.civicrm.org/index.php/topic,31068.msg133374.html#msg133374  I get a page that only shows me my home page again. http://phdeviate.com/?page=CiviCRM&q=civicrm/profile/create&gid=13&reset=1

I also read my way through this: http://wiki.civicrm.org/confluence/display/CRMDOC/Displaying+Public+Forms+in+WordPress+Frontend+Sites But it seems to give the same PHP advice as above, yet it's still not calling the other page.

I've been away from Civi for a while, and this is my first time with the WordPress version. I worked on Drupal 2 years ago, and standalone back in 2009.

Any thoughts?

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: WordPress frontend pages
January 14, 2014, 05:04:29 pm

that information can now be set via the settings page:

http://wp/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/uf&reset=1

if memory serves me right, the code was supposed to be backward compatible. u might want to try the setting and see if that works

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

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
Re: WordPress frontend pages
January 15, 2014, 06:47:08 am
Thank you so much for your prompt reply!

I changed the setting, but the trouble seems to still be the same. Is there anything else that could be causing a link like: http://phdeviate.com/?page=CiviCRM&q=civicrm/mailing/unsubscribe&reset=1&jid=6&qid=5&h=1c8427f22dd33f97

to be showing just my home page?

Thank you again!

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
Re: WordPress frontend pages
January 22, 2014, 09:44:42 am
Are there any other thoughts on this? I've changed themes, altered the setting, and it's still not making these customized links do what they're supposed to.

Thank you!

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
Re: WordPress frontend pages
January 23, 2014, 09:38:07 am
One other thought, should I be doing something to the "WordPress Users Table Name" setting on that same page? I searched the admin manual, but can't find any advice about that setting. My frontend pages are still not working...

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: WordPress frontend pages
January 24, 2014, 08:45:25 am
We have struggled with some pretty similar issues on a WP site I'm involved with. There was a mixture of causes if I recall correctly, and we have still not solved all of the problems. Three main things affected us:

1. the Wordpress install was not default in that the files and directories were not in the locations set by a default installation. The use of the settings_location.php file as described at http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=86213657 might help you in this situation.

2. We used a non-default permalink approach which broke some things for CiviCRM. The WP developer we were working with, an excellent fellow by the name of Bill, came with the following, which appeared to fix things:

Code: [Select]
i. A single-line hack to CRM/Utils/System/WordPress.php - inserting the 'civi_url_base' hook so we can filter out the troublesome '/cms'. In our case the guts of WP was installed in a subdirectory called 'cms', so we had some trouble convincing CiviCRM to look in the right place.

$base = apply_filters( 'civi_url_base', $base ); // JWBP

…inserted in function url immediately before...

if (isset($path)) {



ii. The corresponding filter in the theme's functions.php. (Originally I had this in files/civicrm/php/civicrmHooks.php, but it works more reliably in functions.php)

   function civi_url_base_filter($base) {
      if(substr($base,-5) == '/cms/') {
         $base = substr($base,0,(strlen($base)-4));
      }
      return  $base;
   }
   add_filter('civi_url_base','civi_url_base_filter');

3. We had some issues that were being caused by the theme.
For example, going to http://phdeviate.com/civicrm/?page=CiviCRM&q=civicrm/mailing/unsubscribe&reset=1&jid=6&qid=5&h=1c8427f22dd33f97 appears to show the unsub code above the header of your site's theme. I think this was a relatively straightforward fix, but i can't find it immediately. I'll need to dig back in my emails.

Bill has now mainly retired, but I'll get in touch with him if you like and see if he is able and willing to help out on this.

I had intended to put up a forum post detailing the work we did as I thought it might be useful for others, but as yet I've not found the time to do that.

I hope this of some help.

Best wishes
Graham

Graham Mitchell
http://mc3.coop

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: WordPress frontend pages
January 24, 2014, 08:54:35 am
Update: on the issue of stuff appearing in the wrong place on the page, I found this thread started by Bill: http://forum.civicrm.org/index.php/topic,24544.msg105138.html

Looks to have been built in to version 4.2 onwards, but might be a clue.
Graham Mitchell
http://mc3.coop

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
Re: WordPress frontend pages
January 24, 2014, 12:55:02 pm
Fascinating! That unsub link did *not* work like that the other day. Is it AT ALL possible that something needed more refreshing? Because from when I changed the setting to when you saw the unsubscribe code... if DNS had to refresh, that'd be about right. But that doesn't make sense, does it. In my tests it *just* went to the home page, with no unsubscribe code at all. I'm willing to settle for it over the header. That's trivial, really...

Making some coffee now and hopping on IRC in a few...

wingfingerbill

  • I’m new here
  • *
  • Posts: 18
  • Karma: 1
  • CiviCRM version: 4.4.14
  • CMS version: WordPress 4.1.1
  • MySQL version: 5.6.23
  • PHP version: 5.5.23
Re: WordPress frontend pages
January 24, 2014, 03:19:49 pm
Hi

In the course of trying to track down various WordPress/CiviCRM issues I found it helpful to have a diagnostics page that listed some of the key parameters in the current configuration.

If anyone reading this would like to try out my wf_civi_diagnostics plugin, you can download it from https://drive.google.com/folderview?id=0Byfk_2o5ts1eeHRaX19YWVRqNjQ&usp=sharing (until such time as I decide to remove it).

Please note that:

1. You use this entirely at your own risk.

2. This is a plugin developed primarily for my own use and hasn't been designed, packaged or documented with other users in mind.

3. If it can't find a post called "CiviCRM Diagnostics", it attempts to create one and then adds it to the AdminBar menu.

4. All it does then is to list its findings after any existing content in that post.

5. It makes various reasonable(?) assumptions about where to find things - but bits/all of it might not work if those assumptions are wrong.


If you decide to try it, let us know (via this forum) how you got on.

All the best

Bill

wingfingerbill

  • I’m new here
  • *
  • Posts: 18
  • Karma: 1
  • CiviCRM version: 4.4.14
  • CMS version: WordPress 4.1.1
  • MySQL version: 5.6.23
  • PHP version: 5.5.23
Re: WordPress frontend pages
January 25, 2014, 03:29:15 am
Regarding the issue of the positioning of the unsubscribe links...

The div #crm-container is being inserted immediately after <body>, whereas I would expect it to appear in the main content area, replacing your default content for your "civicrm" page.

IIRC it's possible that you have some code running at that point (or before the html is output?) that calls a filter hooked to "the_content". This could then trigger the civicrm-generated content to be output at that point.

Try disabling widgets/plugins that might be doing this and see if the unsubscribe content moves to the correct position.

Hope this helps

Bill

phdeviate

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
  • CiviCRM version: CiviCRM 4.4.3
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 3.3.10.4
Re: WordPress frontend pages
February 03, 2014, 01:33:55 pm
I suspect this is still all part and parcel of the same issue, but using the anonymous user edit checksum also isn't working, the one on this model:  http://<site root>/civicrm/profile/edit?reset=1&gid=N&id={contact.contact_id}&{contact.checksum}

I get a 404 when I test this.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: WordPress frontend pages
February 03, 2014, 01:49:06 pm
If you remove the contact id and checksum data from the URL can you get to the profile form or does that also give a 404?
Graham Mitchell
http://mc3.coop

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
Re: WordPress frontend pages
February 05, 2014, 02:15:57 pm
When I first tried changing the base page I used "define( 'CIVICRM_UF_WP_BASEPAGE', 'civicrm');" like you did and I couldn't get it to work.  Using trial and error I determined you can't use a base page named 'civicrm' for some reason.  I changed the name to 'CRM' and it worked.

Back when I did this you had to modify the "civicrm.setting.php" file.  Now I set it via "Settings - WordPress Integration".  I also added a blank "CRM" page in WordPress.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • WordPress frontend pages

This forum was archived on 2017-11-26.