Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.37
- This topic has 8 replies, 2 voices, and was last updated 7 years, 6 months ago by
CRAIG HALLER.
-
AuthorPosts
-
02/10/2019 at 4:14 pm #484320
CRAIG HALLER
ParticipantSteve, with your great help I have my site up and running and although ugly, it is working great (in conjunction with with Maps Maker Pro it kicks butt!). Some issues/questions if I may …
- I know I am going straight to hell for this one, but yes, I trivially modified your code, my soul is doomed. I wanted to change the word “Radius” to “Max distance” and tried Say What and other methods to no avail. You have a way to change the zip placeholder, but not that label. Do I have another option? Can you promise to never update your code? (kidding!).
- Is there a cache plugin you recommend or know is compatible? Or any to avoid?
- When someone comes to the site I have the multi-category-search showing and [connections]. I would like there to be only one organization showing (I have a category of “Sample” with one entry) sort of as a default. I can put a screen shot of it under your shortcode as a workaround but that’s not ideal. Suggestion?
- Some of my entries have the same contact email and that is appropriate in my usage. Am I doomed with regards to the Link plugin?
https://schoolorg.directory/ I will be adding my database of 1200 listings shortly.
Thank you. -Craig
02/10/2019 at 4:53 pm #484322CRAIG HALLER
ParticipantAnd connections-initial-search-results is not working for me. It is installed and the box is checked to suppress results.
02/11/2019 at 9:30 am #484348Steven Zahm
Keymaster@ Craig
RE: I wanted to change the word “Radius” to “Max distance” and tried Say What and other methods to no avail.
Yeah, this addon, since it is still beta, is still not 100% translation ready. Editing the code was the only way to make the change.
RE: You have a way to change the zip placeholder, but not that label. Do I have another option?
Hmmm… not sure I follow. There are no labels. Can you attach a screenshot showing what you mean?
RE: Do I have another option? Can you promise to never update your code? (kidding!).
lol, Actually I plan on changing it, a lot, this year. I want to convert this to a new WordPress 5 Editor block. This way I can make setup point and click. :)
RE: Is there a cache plugin you recommend or know is compatible? Or any to avoid?
I personally use and like WP Rocket. For me, it just works. I use to use W3TC. It is a very powerful caching solution, but, I found myself constantly fiddling with its settings after every, single, update to get things working again. When I say updates… not specifically Connections, but WP,the them, any other plugin. In providing support, I come across many users using Super Cache. Another good plugin, but it always seemed to be a little quirky.
Just my experience, so, your result may vary :)
RE: When someone comes to the site I have the multi-category-search showing and [connections]. I would like there to be only one organization showing (I have a category of “Sample” with one entry) sort of as a default. I can put a screen shot of it under your shortcode as a workaround but that’s not ideal. Suggestion?
You could try using this shortcode:
[connections category=X]Where
Xis the category ID of “Sample”For your use, that may or may not work all that well. You might get better results by adding this Code Snippet. I’ve never tested it against the advanced search though.
function cn_reset_category_search_filter( $posts, $WP_Query ) { global $wp_query; $shortcode = 'connections'; $pattern = get_shortcode_regex(); // Grab the array containing all query vars registered by Connections. $registeredQueryVars = cnRewrite::queryVars( array() ); foreach ( $posts as $post ) { // If we're in the main query, proceed! if ( isset( $WP_Query->queried_object_id ) && $WP_Query->queried_object_id == $post->ID ) { /* * $matches[0] == An array of all shortcode that were found with its options. * $matches[1] == Unknown. * $matches[2] == An array of all shortcode tags that were found. * $matches[3] == An array of the shortcode options that were found. * $matches[4] == Unknown. * $matches[5] == Unknown. * $matches[6] == Unknown. */ if ( preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches ) && array_key_exists( 2, $matches ) && in_array( $shortcode, $matches[2] ) ) { // Parse the shortcode atts. $atts = shortcode_parse_atts( $matches[3][ array_search( $shortcode, $matches[2] ) ] ); // Remove the cn-image query vars. $wp_query->query_vars = array_diff_key( (array) $wp_query->query_vars, array_flip( array( 'src', 'w', 'h', 'q', 'a', 'zc', 'f', 's', 'o', 'cc', 'ct' ) ) ); // If the `category` shortcode option is set and the user is not performing a search of any type, limit the results the categories defined by the shorcode option. // If a Connections query var is set, show all results according to the query. if ( isset( $atts['category'] ) && (bool) array_intersect( $registeredQueryVars, array_keys( (array) $wp_query->query_vars ) ) ) { unset( $atts['category'] ); // Rewrite the $atts array to prep it to be imploded. array_walk( $atts, create_function( '&$i,$k','$i="$k=\"$i\"";' ) ); $replace = '[' . $shortcode . ' ' . implode( ' ', $atts ) . ']'; } else { // Rewrite the $atts array to prep it to be imploded. array_walk( $atts, create_function( '&$i,$k','$i="$k=\"$i\"";' ) ); $replace = '[' . $shortcode . ' ' . implode( ' ', $atts ) . ']'; } // Replace the shortcode in the post with something a new one based on you changes to $atts. $post->post_content = str_replace( $matches[0][ array_search( $shortcode, $matches[2] ) ], $replace, $post->post_content ); } } } return $posts; } add_filter( 'the_posts', 'cn_reset_category_search_filter', 1000, 2 );RE: Some of my entries have the same contact email and that is appropriate in my usage. Am I doomed with regards to the Link plugin?
I guess that depends… it it was hoped that contact could edit all entries with their email address … sorry, but that will not work because it is a one-to-one relationship, not one-to-many.
If you allow the contact to register and rely on the autolink feature, based on email. It will seem random as to which entry the user will get linked to.
I think I would suggest only adding the entries that you want to linked to users first. Ensure they get their proper links and then import any of the schools where the contact email is displicate
Hope that makes sense!
RE: And connections-initial-search-results is not working for me. It is installed and the box is checked to suppress results.
Try testing without the caching enabled on your site. Before sure to flush it first. Some caching plugin will still serve old cached pages even when deactivated (cough, cough WP Super Cache). If that work, just exclude the directory page.
I know this is long… but I hope it helps!
02/11/2019 at 11:00 am #484360CRAIG HALLER
ParticipantYou can tell @Melanie (an hour ago she posted) to look at my site
(if you don’t care that I am using you with the Map plugin).
She is welcome to contact me.RE: You have a way to change the zip placeholder, but not that label.
Do I have another option?Hmmm… not sure I follow. There are no labels. Can you attach a
screenshot showing what you mean?Sorry, the “that label” refers to “Radius” … all set on that issue.
RE: When someone comes to the site I have the multi-category-search
showing and [connections]. I would like there to be only one
organization showing (I have a category of “Sample” with one entry)
sort of as a default. I can put a screen shot of it under your
shortcode as a workaround but that’s not ideal. Suggestion?You could try using this shortcode:
[connections category=X]
I tried various permutations. Since I use the multi category search I believe
I need to disabable category select and enable search (see commented out line
which is what I have been using). Tied your suggestion, still not working.
I cleared the cache (in WP and my browser) and removed my cache plugin.<!-- wp:html --> [cn_multi_category_search category="15||Choose an organization type|Search Results: %s” enable_zipcode=true radius_options=”5:5 Miles|10:10 Miles|15:15 Miles|20:20 Miles|30:30 Miles|45:45 Miles” placeholder_zip=”Your zipcode”]
<!-- [connections enable_category_select='FALSE' enable_search='FALSE' category="Sample"]-->[connections category="sample"]

<!-- /wp:html -->
I will try the snippet you sent a little later today.
As for Link, I may remove the email address from additional entries for the same person.
Link will set them up with one, and I can then manually add the others to that person,
correct?Great support!
02/11/2019 at 11:19 am #484361Steven Zahm
Keymaster@ Craig
RE: [connections category="sample"]
The
categoryshortcode take a category ID, a number, not the name. That would explain why it does not work for you.Hope that helps!
02/11/2019 at 11:22 am #484363Steven Zahm
Keymaster@ Craig
fyi, If you wish to share your mapping integration, I would post it up freely on this site in the dev docs.
02/13/2019 at 9:51 pm #484580CRAIG HALLER
ParticipantI am trying to track down a possible conflict with MapMarkers plugin which also relies on the leaflet code. I contacted their tech support since certain icons were not showing. They responded with:
I think the issue might be caused as your site respectively the
“connection” plugin also seems to enqueue leaflet.js, which might be
conflicting here:
https://schoolorg.directory/wp-content/plugins/connections/vendor/leaflet/leaflet.min.css?ver=1.3.4
Can you check if you can disable enqueuing leaflet by that plugin?Can you direct me to where you do the enqueuing so I can check? I really want to see if I can get both plugins to play nicely! And will keep you informed of what I find.
What file of yours does the enqueuing?
02/14/2019 at 8:47 am #484623Steven Zahm
Keymaster@ Craig
RE: your site respectively the
“connection” plugin also seems to enqueue leaflet.jsThew JS file is only enqueued on pages where Connections actually renders a map. Take a second look at the file being included. Notice that is is a CSS file and not a JS file.
RE: I am trying to track down a possible conflict with MapMarkers plugin
It probably a lot better to use the Chrome Dev tools to simply block the file which Connections loading. It’s what I do.
Not knowing the exact issue you are trying to debug, I did find two issues affecting Maps Marker caused by the theme. The icons for the map style layer control and category layer control are not being displayed as well as the map reset. This is because the theme has set the background images for the
atag to0%globally. Why would they do that?Add this to the theme’s custom CSS area generally found in the theme Customizer:
.leaflet-control-layers-toggle { background-size: auto; } .maps-marker-pro .mmp-control-resetview { background-size: auto; }That should correct those issues.
RE: Can you direct me to where you do the enqueuing so I can check? I really want to see if I can get both plugins to play nicely!
Sure, but at this point my finger is pointing at the theme :)
Here is where the CSS is being enqueued:
Here’s where the JS is enqueued:
Hope this helps!
02/14/2019 at 1:09 pm #484641CRAIG HALLER
ParticipantI will play with it this evening, THANK YOU. That css did work. I am not tied to this theme, and the site is rather ugly at this point anyway … lol But I learned to make an active SVG as the header!
If you want, I will give you any feedback I come across as I finish building the site and the integration with your code and theirs. I am trying different things since I have 1200 entries to put in and I know things will be slow. That reminds me,
Swift Performance Lite is a free cache plugin and seems to work well with my configuration. Just saying.I never was able to get your plugin to start up when a user first arrives just showing one category with one item. It does work, but then a search is limited to that category by default and is very confusing. Instead, for now, I changed the name of my sample organization to “1st ….” so that it is at the top of the list. Works for now.
THANK YOU for the great support.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
