toolset_get_related_posts
Started by: leonardM-2
in: Toolset Professional Support
2
2
6 years, 5 months ago
Christian Cox
Connect field group to parent with php
Started by: Mario
in: Toolset Professional Support
1
2
6 years, 5 months ago
Mario
Parent/Child Post Relationship with Gravity Forms Custom Post Types
Started by: Rich Strauss
in: Toolset Professional Support
2
4
6 years, 5 months ago
Luo Yang
Repeatable Field Groups
Started by: Darryl
in: Toolset Professional Support
Quick solution available
Problem: Why use RFGs instead of child posts? My site visitors cannot edit RFGs.
Solution: Tighter integration between RFGs, Views and Forms is on our roadmap. Right now they do behave very much the same. You can edit RFGs using an edit post Form under certain circumstances - only one row can be edited at one time, nested RFG are not supported, and the RFG must be managed in a Form that is separate from the main post.
2
3
6 years, 5 months ago
Darryl
can’t access intermediary post field groups in many2many – HTTP ERROR 500
Started by: ScottM9386
in: Toolset Professional Support
Quick solution available
Problem:
I can't access any intermediary post field groups in the staging site at wpengine - I get:
"This page isn’t working
template1.trackcatalog.wpengine.com is currently unable to handle this request.
HTTP ERROR 500"
Solution:
The user has fixed it by rebuilding from a fresh install.
Relevant Documentation:
2
11
6 years, 5 months ago
ScottM9386
Help with setting Taxonomies the right way.
Started by: Slavy
in: Toolset Professional Support
2
2
6 years, 5 months ago
Nigel
How do I set up conditional content based on if the view produces any content?
Started by: saraG-2
in: Toolset Professional Support
2
2
6 years, 5 months ago
Luo Yang
relationship form in a custom template
Started by: SteffenM1628
in: Toolset Professional Support
2
6
6 years, 5 months ago
Luo Yang
E-Mail Alert
Started by: SteffenM1628
in: Toolset Professional Support
Quick solution available
Problem:
The issue here is that the user wanted his users to be able to subscribe to a notification type. Lets say the user has a Job type and wants to notify user when they subscribe to a notification of a particular job type.
Solution:
This can be done by creating a secondary CPT for the notifications where the user can create the notification type they want for a job.
So on this notification cpt it should have attributes from the Jobs CPT that can be used to match a notification for a Job type. The notification CPT must also have an email field.
Then you can use this code below to send an email to a notification post based on a matching custom field criteria.
//Job Alarm function
add_action('cred_submit_complete', 'my_success_action',10,2);
function my_success_action($post_id, $form_data) {
if ( $form_data['id'] == 67) {
$job_type = get_post_meta($post_id, 'wpcf-position-normal',true);
$job_stelle = (types_render_field( 'stelle-ist-geeignet-fur', array( 'id' => ''.$post_id.'') ));
$notifications = get_posts('post_type=job-alarm');
foreach ($notifications as $notification) {
$email = get_post_meta($notification->ID, 'wpcf-e-mail', true);
$notification_type = get_post_meta($notification->ID, 'wpcf-position-alarm',true);
$notification_stelle = (types_render_field( 'stelle-ist-geeignet-fur-alarm', array( 'id' => ''.$notification->ID.'') ));
if ( $job_type == $notification_type && count(array_intersect(explode(",",$job_stelle), explode(",",$notification_stelle))) > 0) {
wp_mail($email, 'Dein Job Alarm: '.get_the_title($post_id), get_permalink($post_id)."HTML CODE CAN GO HERE");
}
}
}
}
2
63
6 years, 5 months ago
SteffenM1628
MySQL errors while migrating posts relationships
Started by: frasco
in: Toolset Professional Support
2
8
6 years, 5 months ago
Nigel
Post relationship doesn’t save
Started by: davidS-53
in: Toolset Professional Support
Quick solution available
Problem:
A Toolset Form to add a child post doesn’t save the parent post id if there is another form before it on the same page.
Solution:
This resulted from a bug which was fixed in Forms 2.1
2
19
6 years, 5 months ago
davidS-53
MySQL errors while migrating posts relatioships
Started by: frasco
in: Toolset Professional Support
2
9
6 years, 5 months ago
frasco
Conditional Output based on post relationships
Started by: daveG-7
in: Toolset Professional Support
Quick solution available
Problem:
Client wants to use the wpv-conditional shortcode with a test for whether the current post has any connected posts from some relationship.
Solution:
That requires registering a custom shortcode that will return the number of connected posts, like so:
/**
* Register connections shortcode
*
* <a href="https://toolset.com/forums/users/att/" rel="nofollow" tabindex="79">@att</a> (string) relationship : post relationship slug
* @return count of connected posts
*/
add_shortcode( 'connections', function( $atts = [] ){
// provide defaults
$atts = shortcode_atts(
array(
'relationship' => '',
),
$atts
);
global $post;
$count = 0;
$relationship = toolset_get_relationship( $atts['relationship'] );
if ( $relationship ) {
$parent = $relationship['roles']['parent']['types'][0];
$child = $relationship['roles']['child']['types'][0];
$type = $post->post_type;
$origin = ( $parent == $type ) ? 'parent' : 'child';
// Get connected posts
$connections = toolset_get_related_posts( $post->ID, $atts['relationship'], $origin, 9999, 0, array(), 'post_id', 'other', null, 'ASC', true, $count );
}
return $count;
});
You need to specify the relationship slug like so:
[connections relationship='cocktail-spirit']
And the custom shortcode will need registering at Toolset > Settings > Front-end Content to be able to use it in wpv-conditional shortcodes.
Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/
3
6
6 years, 5 months ago
ian-scottP
Relationship use title in the dropdown i want to use a custom post type
Started by: rexJ-2
in: Toolset Professional Support
3
4
6 years, 5 months ago
Shane
Remove post related form fields from post type
Started by: Jim
in: Toolset Professional Support
Quick solution available
Problem:
The issue here is that the user wanted to limit his custom field group to a single CPT
Solution:
You can actually do this by going to your field group under the setting Appears On, you can select the CPT that this field group should only appear on.
2
3
6 years, 5 months ago
Jim