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.5.14, custom field
- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by
Steven Zahm.
-
AuthorPosts
-
04/17/2016 at 11:27 am #373165
Matt
GuestHey Steve,
Hope you are excellent!
I successfully created a code snippet to add checkboxes to the Edit Entry and it is working, but I am unable to get the information I want to appear on the displayed entry using my custom card-single.php. If the checkbox is checked, I want it to display the fields ‘name’ and ‘desc’ when the entry is displayed. Thanks for your help! -Matt. Here is my code thus far:
04/18/2016 at 10:45 am #373268Steven Zahm
Keymaster@ Matt
You would add this to your template:
$region_1 = $entry->getMeta( array( 'key' => 'region_id_1', // This should match exactly the field id used when registering the custom field. 'single' => TRUE // Do not change this. ) ); echo if ( $region_1 ) 'All of Minnesota.';
Hope that helps!
04/18/2016 at 3:59 pm #373287Matt
GuestSteve,
Thanks for your help! We are getting there. I got it to display “All of Minnesota.” Sweet. However, the array is just grabbing the 1 key. How do I get it grab all the keys for each region_id_# (1-8)? Do I need to copy and paste the array 7 more times and customize each of them? I thought arrays had the ability to grab all the info and store it, so I can pull out what I need?
Matt
04/19/2016 at 11:17 am #373342Steven Zahm
Keymaster@ Matt
The fields you set up are a individual checkboxes. These are not saved in the db as an array, they are saved as individual unique rows in the db. A checkbox group, would be saved as a single unique row as a json encoded array in the db.
I think the confusion is that the fields are setup and registered using arrays which has no bearing on the date is saved and retrieved (well, in a way it does, based that is based on the field type).
re: How do I get it grab all the keys for each region_id_# (1-8)? Do I need to copy and paste the array 7 more times and customize each of them?
Yes, take the code I gave and change the
key
value to the registered field ID.re: I thought arrays had the ability to grab all the info and store it, so I can pull out what I need?
You can if you use a checkbox group
Hope that helps.
05/02/2016 at 9:48 am #374895Steven Zahm
KeymasterMaking resolved due to inactivity.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.