Is there an option when using param_group to have new rows toggled open by default. It seems odd that when using a param_group, you add a new row row, and its toggled collapsed. It would be great if when you add new rows, they're open by default.
Asked
Active
Viewed 282 times
1 Answers
1
As of writing this in 2021 there is no default method to do this. The way to force this if you really need it is to use the "vc_backend_editor_enqueue_js_css" and "vc_frontend_editor_enqueue_js_css" hooks to load a JS script that will add the "vc_param_group-collapsed" to all of the list items after a new one is added and then remove it from the newly added item.
Also if you want the first item open when the edit screen comes up you can use the following code:
add_filter('vc_param_group_render_filter', function($outputHTML) {
return preg_replace("/vc_param wpb_vc_row vc_param_group-collapsed/", "vc_param wpb_vc_row", $outputHTML, 1);
});

Mav2287
- 796
- 2
- 9
- 22