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? Commented Feb 8, 2019 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
    Commented Feb 8, 2019 at 5:27
  • Like @jitendra-fuzion I also see titles Commented Feb 8, 2019 at 17:00

3 Answers 3


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
    Commented Feb 8, 2019 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
    Commented Feb 8, 2019 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. Commented Feb 9, 2019 at 20:28
  • Have you found a solution? I don't know how to transform the code above to fit into civievent-widget.php? Commented Mar 4 at 19:11

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. Commented Feb 8, 2019 at 17:17

I changed line 322 to

$row .= '<a href="mydomain.com/civicrm/event/info/?reset=1&id=' . $event['event_id'] . '">' . $event_type . ': ' . $title . '</a>';

and it works. it's not the best way to do it, but...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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