AndreG3332
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
---|---|---|---|---|---|
How Do i create a date filter for a View
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: The user wanted to create a parametric search for users. Solution: This way you can filter for their profiles rather than the actual user. Take a look at this link below. |
2 | 3 | vor 6 Jahren | ||
Display the value of a field instead of the field itself
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 7 | vor 6 Jahren | ||
to display filtered results in a view depending on the logged in user
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 2 | vor 6 Jahren | ||
Field validation of post form
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: I would like to add custom validation to a Form that tests to see if any other post has the same custom field value. If so, an error should be displayed. Solution: Use the Forms validation API to query posts by meta key and value: add_filter( 'cred_form_validate', 'require_unique_doc_num_validation', 10, 2 ); function require_unique_doc_num_validation( $data, $form_data ) { $forms = array( 63, 456 ); // a comma-separated list of form IDs you want to validate $post_type_slug = 'document-master-list'; // your document cpt slug $field_slug = 'document-number'; // the field slug of the unique number from wp-admin $error_message = 'Unique document number is required'; // the error message you want to display // you should not edit anything below this line list($fields,$errors)=$data; if ( in_array( $form_data['id'], $forms ) ) { if ( !isset($fields['wpcf-' . $field_slug]['value'])) { $errors[$field_slug] = $error_message; } else { $doc_args = array( 'post_type' => $post_type_slug, 'numberposts' => -1, 'meta_query' => array( array( 'key' => 'wpcf-' . $field_slug, 'value' => $fields['wpcf-' . $field_slug]['value'] ) ), ); $matching_docs = get_posts( $doc_args ); if ( count($matching_docs) > 0 ) { $errors[$field_slug] = $error_message; } } } $data =array($fields,$errors); return $data; } Relevant Documentation: |
2 | 11 | vor 6 Jahren | ||
Open child cred form from with in parent cred from
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: Solution: The expected workflow would be something like a form to publish the parent CPTs is inserted on one page, which displays the post after submission. The template for that post type includes a link to an edit form for the post, and also includes the form to add child posts (either directly, or linking to the form). |
2 | 3 | vor 6 Jahren | ||
Setting up a relational post form
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: Setup relationship form using many-to-many relationship. Solution: Here are detail steps: https://toolset.com/forums/topic/setting-up-a-relational-post-form/#post-1154440 Relevant Documentation: |
2 | 7 | vor 6 Jahren | ||
Display parent details as part of child post and open cred form when clicked
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: I would like to display information from two different grandparent post types on a parent post. I would also like to create a Form that creates child posts, and insert a link to that Form on the parent post so that the parent is automatically selected. Solution: Create a View of Requirement CPTs. In the Loop, you can insert the post title shortcode to display the related Company name. Click "Fields and Views", then "Post title", and you will be shown a popup. Click the "Post Selection" tab, then choose "A post related to the current post, set by a Types relationship". Next, select the Company post in your Company > Requirement post relationship. Create the new Submission Post Form and insert it in a custom Page. Then return to the View of Requirements editor and use the Toolset Forms button above the Loop Editor to insert a "Create Child Post Link". Select the Page containing the Submission Post Form, and a link will be automatically inserted for you. When Users click the link, they will be directed to the Page containing the new Submission Form. If you want to hide the parent select field in the Form, you can use CSS in the Form editor. <div style="display:none;"> [cred_field field="@relationship-slug.parent" class="form-control" output="bootstrap" select_text="--- not set ---"] </div> Relevant Documentation: |
2 | 4 | vor 6 Jahren | ||
Bulk editing of details
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 3 | vor 6 Jahren | ||
Set a child post title from parent post titles with code
Gestartet von: AndreG3332
in: Toolset Professional Support
Problem: I have a Form that creates posts and allows the User to choose two post parents from other post types. I would like to use the Forms API to automatically set the child post title to include the title of both parent posts. Solution: add_action('cred_save_data', 'your_save_data_action',10,2); function your_save_data_action($post_id, $form_data) { // if a specific form if ($form_data['id']==138) { $docyear = get_post_meta($post_id, 'wpcf-year', true); $custname = isset($_POST['@customer-requirement_parent']) ? get_the_title($_POST['@customer-requirement_parent']) : ''; $docname = isset($_POST['@document-master-list-requirement_parent']) ? get_the_title($_POST['@document-master-list-requirement_parent']) : ''; $drdetail= $docyear. ' - ' . $custname. ' - ' . $docname; $args = array('ID' => $post_id, 'post_title' => $drdetail); wp_update_post($args); } } Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data |
2 | 3 | vor 6 Jahren | ||
Can you setup relationship fields with a user?
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 3 | vor 6 Jahren, 1 Monat | ||
Set post title with fields from CPT Not working
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 2 | vor 6 Jahren, 1 Monat | ||
Data validation on input forms
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 2 | vor 6 Jahren, 1 Monat | ||
How to setup a front end form with a parent and two child posts
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 4 | vor 6 Jahren, 1 Monat | ||
Auto population of table
Gestartet von: AndreG3332 in: Toolset Professional Support |
2 | 8 | vor 6 Jahren, 1 Monat | ||
linking parent and child forms
1
2
Gestartet von: AndreG3332 in: Toolset Professional Support |
3 | 24 | vor 6 Jahren, 10 Monaten |