Forum Replies Created
-
AuthorPosts
-
Roland Stumpp
ParticipantHi Steven,
this is our snippet for the im- and export from our custom fields.
the first one for the export and the second for the import.
The field herden_name is a text field.
The fields genussfleisch,biologisch and herdbuch_zuechter is a checkbox. The last one rinder_farbe is a checkboxgroup. Are the snippets ok?Regards
Rolandadd_filter( 'cn_csv_export_fields', 'cn_register_text_field_header' );add_filter( ‘cn_csv_export_fields_config’, ‘cn_register_text_field_config’ );
function cn_register_text_field_header( $fields ) {
$fields['herden_name'] = 'Herdenname'; $fields['genussfleisch'] = 'Genussfleischpartner'; $fields['biologisch'] = 'Biobetrieb'; $fields['herdbuch_zuechter'] = 'Herdbuchzucht'; $fields['rinder_farbe'] = 'Farbschlag'; return $fields;}
function cn_register_text_field_config( $fields ) {
$fields[] = array( 'field' => 'herden_name', 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); $fields[] = array( 'field' => 'genussfleisch', 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); $fields[] = array( 'field' => 'biologisch', 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); $fields[] = array( 'field' => 'herdbuch_zuechter', 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); $fields[] = array( 'field' => 'rinder_farbe', 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); return $fields;}
add_filter( ‘cncsv_map_import_fields’, ‘cncsv_header_name’ );
add_action( ‘cncsv_import_fields’, ‘cncsv_process_import’, 10, 3 );function cncsv_header_name( $fields ) {
$fields['herden_name'] = 'Herdenname'; $fields['genussfleisch'] = 'Genussfleischpartner'; $fields['biologisch'] = 'Biobetrieb'; $fields['herdbuch_zuechter'] = 'Herdbuchzucht'; $fields['rinder_farbe'] = 'Farbschlag'; return $fields;}
function cncsv_process_import( $id, $row, $entry ) {
$data = $entry->arrayPull( $row, 'herden_name', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ); $data = $entry->arrayPull( $row, 'genussfleisch', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ); $data = $entry->arrayPull( $row, 'biologisch', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ); $data = $entry->arrayPull( $row, 'herdbuch_zuechter', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ); $data = $entry->arrayPull( $row, 'rinder_farbe', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'herden_name', 'value' => $data ), ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'genussfleisch', 'value' => $data ), ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'biologisch', 'value' => $data ), ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'herdbuch_zuechter', 'value' => $data ), ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'rinder_farbe', 'value' => $data ), ) );}
Roland Stumpp
ParticipantHi Steven,
the template overrides are in the card.php in the plugin connections-tile-plus.
After every update my changes are gone!Regards
RolandRoland Stumpp
ParticipantHi Steven,
it is possible to import and export a custom field. We include this for a custom field:
But what we have to include in the import and export a custom checkbox and a custom checkbox group too?
Do you have the code snippet for us please
Regards
Roland
-
This reply was modified 7 years, 5 months ago by
Roland Stumpp.
-
This reply was modified 7 years, 5 months ago by
Roland Stumpp.
Roland Stumpp
ParticipantHi Steven,
and by the way… we are using connections-tile-plus
our override is in the card.php from the plugin.
Is it possible to have the card.php in the child area?
Regards
RolandRoland Stumpp
ParticipantHi,
meanwhile we have all the custom fields and boxes inside. Your documentation is very good!
But one question is still open. Inside connections is the the class.geo.php. We would like to use the function “Find the closest locations”
Are we have to buy a additional plugin?
How is the way to use it?Regards
RolandRoland Stumpp
ParticipantHi Steven,
and which theme is the best to be used in a columnar format?
We have to display 650 members.
And it is not important to show a google map.
For us it is important to have categories and to find the member for example within a radius of 100 kilometers of a location or postcode.Do you have a solution for this?
Regards
Roland -
This reply was modified 7 years, 5 months ago by
-
AuthorPosts
