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.1.5, shortcode, slim plus, str_select, str_select_all
- This topic has 12 replies, 2 voices, and was last updated 11 years, 9 months ago by
Steven Zahm.
-
AuthorPosts
-
11/13/2014 at 9:00 am #309813
Steven Zahm
Keymaster@ Steve
First, add the following to your theme’s custom CSS area. It’ll make the drop down more visible:
#cn-slim-plus select#cn-cn-region { min-width: 250px; }The “Select a State” might not be displaying for you because of tweaks I’ve made to my dev version to make it work.
After another test, if you use the following code … it”l at least show “Select an option“. And when I release version 8.1.6, it should automatically say “*Select a State”:
function cn_state_select() { global $wpdb; $sql = 'SELECT state FROM ' . CN_ENTRY_ADDRESS_TABLE . ' GROUP BY state'; $result = $wpdb->get_col( $sql ); $keys = array_map( 'urlencode', $result ); $values = array_map( 'esc_attr', $result ); $states = array_combine( $keys, $values ); cnHTML::select( array( 'id' => 'cn-region', 'name' => 'cn-region', 'options' => $states, 'enhanced' => TRUE, 'default' => 'Select a State' ) ); } add_action( 'cn_action_list_before-slim-plus', 'cn_state_select', 98 ); function cn_add_submit_button( $atts, $results ) { cnTemplatePart::submit( array( 'return' => FALSE ) ); } add_action( 'cn_action_list_before-slim-plus', 'cn_add_submit_button', 99, 2 ); function cn_disable_category_select( $atts ) { $atts['enable_category_select'] = FALSE; return $atts; } add_filter( 'cn_list_atts-slim-plus', 'cn_disable_category_select', 9 );The
99, filter your results by it. Four entries have the state set as99. The drop down will show exactly what what was entered in the db. It will not validate the results. Future versions will standardize this a bit by making the state and country fields autocomplete drop downs (that’s why there’re option in the settings to set the default country and region/state). These drop downs will not force a value to be used (letting any value to be entered) but since the selection will be shown it’ll be a strong encouragement to use the value in the drop down rather than a random value. I have to do it this way for backward compatibility because all sorts of stuff/variations have been entered into these fields and I have to make sure not to break that.11/14/2014 at 2:32 pm #309937Steve Yancharas
GuestThanks Steven, embarrassingly enough I think the … was because the select box wasn’t wide enough to begin with, and thanks for the info about the 99, I wouldn’t of thought to check for states with 99. Is there anywhere else on the web I can give you a review?
11/15/2014 at 1:42 pm #310110Steven Zahm
Keymaster@ Steve
Sure I would love a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
