Answers.Body: <p>This is a bug in CiviEvent Widget - though an understandable one. </p>
  
  <p>The widget uses <code>CRM_Utils_System::url()</code> to construct URLs to the CiviEvents but -- when the widget is viewed on a page/post where there is a CiviCRM shortcode present -- the <code>url()</code> 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.</p>
  
  <p>The solution would be for CiviEvent Widget to construct URLs that <em>always</em> point to the WordPress basepage, whose "slug" (which is its <code>$post-&gt;post_name</code>) is available via <code>$config-&gt;wpBasePage</code>. Something like this in its code:</p>
  
  
  
  <pre><code>$config = CRM_Core_Config::singleton();
  $slug = $config-&gt;wpBasePage;
  $post = get_page_by_path( $slug );
  $basepage_url = get_permalink( $post-&gt;ID );
  </code></pre>
  
  <p>Indeed, I see that the plugin already <a href="https://github.com/agh1/civievent-widget/blob/5d897a312f51343126544a13d52541fc5b83353c/civievent-widget.php#L186" rel="nofollow noreferrer">accesses the basepage slug</a> so it's almost there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-08T18:47:16.580Z
Answers.Text: 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:  https://github.com/agh1/civievent-widget/issues/1
Answers.UserDisplayName: Ruth D
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-08T18:48:40.447Z
Answers.Text: Can you think of any workaround I could use?  Absent that, what process should I use to encourage AGH to fix this?
Answers.UserDisplayName: Ruth D
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-09T20:28:06.457Z
Answers.Text: @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.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-04T19:11:52.737Z
Answers.Text: Have you found a solution? I don't know how to transform the code above to fit into civievent-widget.php?
Answers.UserDisplayName: Fredatipik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-12-18T17:04:45.233Z
Answers.Text: @Fredatipik It looks abandoned. :shrug:
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-08T17:36:01.630Z
Answers.LastActivityDate: 2019-02-08T17:36:01.630Z
Answers.UserDisplayName: Christian Wach
Answers.Body: <p>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. </p>
  
  <p>One has: <a href="http://test.californianational.party/civicrm/?page=CiviCRM&amp;q=civicrm/event/info&amp;reset=1&amp;id=161" rel="nofollow noreferrer">http://test.californianational.party/civicrm/?page=CiviCRM&amp;q=civicrm/event/info&amp;reset=1&amp;id=161</a></p>
  
  <p>The other has: <a href="http://test.californianational.party/donate2/?page=CiviCRM&amp;q=civicrm/event/info&amp;reset=1&amp;id=161" rel="nofollow noreferrer">http://test.californianational.party/donate2/?page=CiviCRM&amp;q=civicrm/event/info&amp;reset=1&amp;id=161</a></p>
  
  <p>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?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-08T17:17:49.890Z
Answers.Text: 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.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-08T09:05:04.277Z
Answers.LastActivityDate: 2019-02-08T09:05:04.277Z
Answers.UserDisplayName: Jenni Simonis
Answers.Body: <p>I changed line 322 to</p>
  <pre><code>$row .= '&lt;a href=&quot;mydomain.com/civicrm/event/info/?reset=1&amp;id=' . $event['event_id'] . '&quot;&gt;' . $event_type . ': ' . $title . '&lt;/a&gt;';
  </code></pre>
  <p>and it works. it's not the best way to do it, but...</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-17T08:38:09.773Z
Answers.LastActivityDate: 2024-03-17T08:38:09.773Z
Answers.UserDisplayName: Fredatipik
Body: <p>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 <strong>without</strong> the title!</p>
  
  <p>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 <a href="http://test.californianational.party" rel="nofollow noreferrer">test.californianational.party</a></p>
  
  <p>Does anyone have any ideas on how to go about solving this, especially from AGH Strategies or Christian Wach?  Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-08T05:06:21.757Z
Comments.Text: I do see an event title at http://test.californianational.party/civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=159 "CHAPTER MEETING" - Is that not the title you want?
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-08T05:27:59.297Z
Comments.Text: 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?
Comments.UserDisplayName: Ruth D
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-08T17:00:20.613Z
Comments.Text: Like @jitendra-fuzion I also see titles
Comments.UserDisplayName: Christian Wach
Tags: <wordpress><civievent><admin><plugin><widget>
Title: CiviEvent Widget: Event Title Not Showing on Event Info Page
ThreadText: # CiviEvent Widget: Event Title Not Showing on Event Info Page
  
  (Asked by: username_0 on 2019-02-08)
  
  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](http://test.californianational.party)
  
  Does anyone have any ideas on how to go about solving this, especially from AGH Strategies or username_2? Thanks!
  
  **Tags:** wordpress, civievent, admin, plugin, widget
  
  > **Comments:**
  > **username_1**: I do see an event title at http://test.californianational.party/civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=159 "CHAPTER MEETING" - Is that not the title you want?  
  > **username_0**: 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?  
  > **username_2**: Like @jitendra-fuzion I also see titles  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2019-02-08. Score: 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.
  
  > **Comments:**
  > **username_0**: 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:  https://github.com/agh1/civievent-widget/issues/1  
  > **username_0**: Can you think of any workaround I could use?  Absent that, what process should I use to encourage AGH to fix this?  
  > **username_2**: @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.  
  > **username_3**: Have you found a solution? I don't know how to transform the code above to fit into civievent-widget.php?  
  > **username_2**: @username_3 It looks abandoned. :shrug:  
  
  ---
  
  ### Answer by username_4 on 2019-02-08. Score: 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?
  
  > **Comments:**
  > **username_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.  
  
  ---
  
  ### Answer by username_3 on 2024-03-17. Score: 0
  
  I changed line 322 to
  $row .= '' . $event_type . ': ' . $title . '';
  
  and it works. it's not the best way to do it, but...
  
  
  ---
  
  