Notice: Trying to get property 'ID' of non-object in /html/wordpress/wp-content/
Started by: georgesw
in: Toolset Professional Support
2
3
4 years, 11 months ago
Jamal
Adding Class to Img Tag / Custom Image Size Not Loading via Shortcode
Started by: JoelK2744
in: Toolset Professional Support
Quick solution available
Problem:
The user is using a lazy loading plugin to optimize the loading of images, he needs to add a specific class to the tag generated by the Image block.
The classes added to the image block settings are added in the
tag that wraps the tag.
Solution:
We can work around this using custom code:
function add_class_to_image_block( $block_content, $block ) {
if ( $block['blockName'] === 'toolset-blocks/image' ) {
return str_replace( '<img src', '<img class="my-class" src', $block_content );
}
return $block_content;
}
add_filter( 'render_block', 'add_class_to_image_block', 10, 2 );
Relevant Documentation:
https://developer.wordpress.org/reference/hooks/render_block/
2
6
4 years, 11 months ago
JoelK2744
Scroll down to view’s results
Started by: JoelK2744
in: Toolset Professional Support
Quick solution available
Problem:
The user has an AJAX-based search view and he would like to scroll down to the results after an AJAX search completes
Solution:
Rely on the view's Javascript events to execute a scroll-down command to the element that holds the results:
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.layout (object) The jQuery object for the View layout wrapper
*/
console.log('results updated');
jQuery('html, body').animate({
scrollTop: jQuery(".js-wpv-loop-wrapper").offset().top - 70
}, 1000);
});
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax/
2
5
4 years, 11 months ago
JoelK2744
Create a table with a custom search, filtering, pagination.
Started by: LennyS7960
in: Toolset Professional Support
2
3
4 years, 11 months ago
LennyS7960
External links are opening as pages of my current site
Started by: aharonK
in: Toolset Professional Support
Quick solution available
Problem:
Links in URL custom field gets appended to site url when clicked rather than going to the URL that is stored in the field.
Example when google.com is entered into the url field it gives the below on the frontend
mysite.com/google.com
Solution:
This is happens because you are adding the URL to a url field without adding http:// before the actual URL.
You will need to edit your fields to include the http:// to resolve the issue. Secondly I would recommend enabling the field validation for this In your field settings at Toolset -> Custom fields.
This will ensure that only valid URL's are added to the field and prevent this from happening in the future.
2
3
4 years, 11 months ago
aharonK
Map using view block markers not reloading properly
Started by: tenseg
in: Toolset Professional Support
2
5
4 years, 11 months ago
tenseg
conditional on radio field
Started by: Eric
in: Toolset Professional Support
2
11
4 years, 11 months ago
Jamal
I don't see any field in "Form Editor" in "Add New Post Form" option
Started by: davidM-65
in: Toolset Professional Support
2
7
4 years, 11 months ago
Jamal
Toolset not really load the bootstrap 4 css
Started by: kelvinL-2
in: Toolset Professional Support
1
3
4 years, 11 months ago
kelvinL-2
Forms not working
Started by: marieC-2
in: Toolset Professional Support
2
3
4 years, 11 months ago
marieC-2
Source Post Title from Related Post Source returns 'no content' in View Loop
Started by: Anthony
in: Toolset Professional Support
2
5
4 years, 11 months ago
Anthony
Delete old plugins and reinstall new ones causes fatal errors
Started by: jeffreyH-3
in: Toolset Professional Support
2
3
4 years, 11 months ago
jeffreyH-3
View query filter for whether an image custom field has content
Started by: Anthony
in: Toolset Professional Support
Quick solution available
Problem:
The issue here is that the user wanted to filter their view with a query filter to not include posts where the image custom field is empty.
Solution:
This can be done with the hook below.
//Return only products with banner images
add_filter( 'wpv_filter_query', 'filter_empty_banners', 99, 3 );
function filter_empty_banners( $query_args,$view_settings ,$view_id ) {
if ( $view_id == 44576) {
$query_args['meta_query'] = array(
array(
'key' => 'wpcf-banner',
'value' => '',
'compare' => '!='
)
);
}
return $query_args;
}
Add the above to your Toolset custom code section in Toolset -> Custom Code and activate it. You will need to change the 44576 to your view's id as well as the wpcf-banner to the slug of your image field keeping the wpcf- prefix.
2
5
4 years, 11 months ago
Anthony
Can not delete my website registration.
Started by: colinF-3
in: Toolset Professional Support
1
2
4 years, 11 months ago
colinF-3
Conditionals based on parent custom field
Started by: John
in: Toolset Professional Support
2
6
4 years, 11 months ago
Shane