Hi Steven,
Actual I just found a function snippet that worked which you provided a few years ago for another website we worked on, that had the same need. 🙂
Thanks!
Mitch
Plugin Author
Steven
(@shazahm1hotmailcom)
Good to hear you found the solution! I do have to apologize!!! It seems to have missed your reply to the other support forum thread. It this the same issue?
Hi Steven,
Yes, it actually was the same issue. 🙂 It just hit me that you had helped us with the same issue a few years ago, so luckily I found the snippet code needed.
Thanks again! 🙂
Mitch
Plugin Author
Steven
(@shazahm1hotmailcom)
ok, I’ll mark both resolved.
If I may… can you share the code snippet, so I can refresh my memory. Thanks and have a great evening.
Hi Steven,
Not a problem. Here is that snippet.
Connections :: Load Template Based on Entry Type
add_filter(
'cn_load_template',
function( $atts ) {
if ( $slug = cnQuery::getVar( 'cn-entry-slug' ) ) {
// Grab an instance of the Connections object.
$instance = Connections_Directory();
$result = $instance->retrieve->entry( $slug );
if ( false !== $result ) {
$atts['list_type'] = $result->entry_type;
}
}
return $atts;
}
);
This basically allowed the Directory to use a different page template than the profile page template without having to use “home_id” for the shortcode on the Directory page. The profile page template is then able to utilize the “Individual” template type we chose in the template settings, without having to use the “home_id” for the Directory shortcode. So as a result we can use the category, keyword search, alpha filter, etc., on the Directory page and have that resolve using the Directory page template, instead of the “home_id” template of the profile page as it was trying to do previously. If that makes sense. 🙂
Thanks!
Mitch
Plugin Author
Steven
(@shazahm1hotmailcom)
Ok, I remember writing this now. Thanks!