1

I am using the CiviEvent Widget in the sidebar of my website. Normally, clicking on an event's title in the sidebar brings up the event's info page just fine; same with clicking on the Register button for that event. However, if I happen to be sitting on a page with a Civi form on it (like an email list signup or donation page), when I click on that same event's title in the sidebar it brings up the event's info page but without the title!

I'm using Wordpress 4.9.9 and Civi 4.7.29. I use the CiviCRM Admin Utilities plugin to disable the Default CiviCRM stylesheet and the CiviCRM Menu stylesheet, and style ourselves the civi-generated pages. But when I Inspect that event page missing the title, I don't even see it there in the html to display. This in-development website is at test.californianational.party

Does anyone have any ideas on how to go about solving this, especially from AGH Strategies or Christian Wach? Thanks!

  • I do see an event title at test.californianational.party/civicrm/… "CHAPTER MEETING" - Is that not the title you want? – jitendra - fuzion Feb 8 at 5:06
  • Did you get to it by 1st looking at an empty form page, then from the sidebar of that empty form page, clicking on the event's link in the sidebar? – Ruth D Feb 8 at 5:27
  • Like @jitendra-fuzion I also see titles – Christian Wach Feb 8 at 17:00
4

This is a bug in CiviEvent Widget - though an understandable one.

The widget uses CRM_Utils_System::url() to construct URLs to the CiviEvents but -- when the widget is viewed on a page/post where there is a CiviCRM shortcode present -- the url() method returns public-facing URLs using the permalink of the page/post instead of the WordPress "basepage". FWIW, the reason for this is that the CiviCRM forms treat the post where the shortcode is embedded "as if" it were the basepage.

The solution would be for CiviEvent Widget to construct URLs that always point to the WordPress basepage, whose "slug" (which is its $post->post_name) is available via $config->wpBasePage. Something like this in its code:

$config = CRM_Core_Config::singleton();
$slug = $config->wpBasePage;
$post = get_page_by_path( $slug );
$basepage_url = get_permalink( $post->ID );

Indeed, I see that the plugin already accesses the basepage slug so it's almost there.

  • Thank you so much Jenni and Christian, at least there is an explanation! I see now that it looks to be a bug reported way back in 2015: github.com/agh1/civievent-widget/issues/1 – Ruth D Feb 8 at 18:47
  • Can you think of any workaround I could use? Absent that, what process should I use to encourage AGH to fix this? – Ruth D Feb 8 at 18:48
  • @RuthD I can't think of a workaround, nor do I know how you'd persuade AGH to fix this if Dana has also failed to do so. What I can do is add a method to CiviCRM Core (and/or the WordPress plugin) for retrieving URLs which target the basepage. Perhaps AGH would be willing to update the widget if that existed -- but that's out of my hands I'm afraid. – Christian Wach Feb 9 at 20:28
  • Thank you, Christian – Ruth D Feb 10 at 1:35
2

When I try an event page the two ways (one from the events listing under Get Involved, one from going thru the donate page's sidebar), the URLs for the same pages are different.

One has: http://test.californianational.party/civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=161

The other has: http://test.californianational.party/donate2/?page=CiviCRM&q=civicrm/event/info&reset=1&id=161

This is for the exact same page (id=161). When this happens, that entire page header portion is being dropped. It feels like a difference in templates/themes is being pulled because of the page URLs being different?

  • 2
    This is the key observation to solving the problem. I haven't got enough space to detail the issue here, so I'm posting a separate answer. – Christian Wach Feb 8 at 17:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.