From: Steve Sutton Date: Fri, 28 Apr 2017 20:12:29 +0000 (-0400) Subject: Adding attribute for event list (pageslug) X-Git-Tag: v1.6.38^2~4^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a87f394fb205fa92f424e9da4ef03ce996d0d36d;p=WP-Plugins%2Fglm-member-db-events.git Adding attribute for event list (pageslug) This will be used to allow for a custom event list page that has their own event detail page. TODO: Need to work on getting this to work with populating the page title. Also the url won't have the event name slug in it. --- diff --git a/models/front/events/list.php b/models/front/events/list.php index 34ffd0e..df02a4a 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -67,7 +67,14 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction $venueId = null; $eventDays = array(); $eventDay = null; + $pageSlug = 'event-detail'; + $customPage = false; + // If there's a pageslug as attribute then update the pageSlug + if ( isset ( $actionData['request']['pageslug'] ) ) { + $pageSlug = $actionData['request']['pageslug']; + $customPage = true; + } // If a memberID has been specified, limit to that member if ( isset( $actionData['request']['member'] ) ) { $memberId = $actionData['request']['member'] - 0; @@ -779,6 +786,8 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction 'imgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/small/', 'calDates' => $calDates, 'cal_view' => $calendar_view, + 'pageSlug' => $pageSlug, + 'customPage' => $customPage, // 'override' => $override_default_view ); error_reporting(E_ALL ^ E_NOTICE); diff --git a/setup/frontHooks.php b/setup/frontHooks.php index db648e1..b9e1399 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -60,7 +60,7 @@ add_action('wp_loaded', function() { * * We're also going to set the page title to the event name in here while we're at it. */ -if (strpos(GLM_MEMBERS_PLUGIN_CURRENT_URL, $this->config['settings']['canonical_event_page']) > 0) { +if (strpos(GLM_MEMBERS_PLUGIN_CURRENT_URL, '/'.$this->config['settings']['canonical_event_page']).'/' > 0) { // Parse out only the event slug from the current URL $m = array(); diff --git a/setup/shortcodes.php b/setup/shortcodes.php index beaf407..b30a021 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -107,6 +107,7 @@ $glmMembersEventsShortcodes = array( 'featured' => null, 'current' => null, 'category' => null, + 'pageslug' => null, ) ), 'glm-members-event-detail' => array( diff --git a/views/front/events/agenda.html b/views/front/events/agenda.html index b6243cc..896e19e 100644 --- a/views/front/events/agenda.html +++ b/views/front/events/agenda.html @@ -80,7 +80,7 @@ {if $event.image}{/if} {$event.intro}
- Read More + Read More