Skip Navigation

[Resolved] Customise repeatable custom images in a form

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to translate the "Add New" and "Delete" buttons for repeating fields in a Form.

Solution: Use the following custom code snippets or translate using WPML String Translation. The strings are registered in the wpv-views text domain.

add_filter('toolset_button_delete_repetition_text', 'toolset_button_delete_repetition_text', 10, 2);
function toolset_button_delete_repetition_text($text, $config)
{
    return 'Your own custom delete text';
}
 
add_filter('toolset_button_add_repetition_text', 'toolset_button_add_repetition_text', 10, 2);
function toolset_button_add_repetition_text($text, $config)
{
    return 'Your own custom add new text';
}
This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1103279

We use a repeatable custom image field and would like, when displaying it in a form, to customise it a bit:
Most important would be to display the images as thumbnails in a row and to be able to translate (or change the image) for the "Add new" since it's not going to be in english.
It would also be nice to drag and drop the images directly instead of using the arrow-icon.
How can these things be done?

#1103768

Hi, the display of each repeated image isn't currently very flexible, so I don't have a good solution that will allow you to show them on a single row or drag and drop outside the "move" arrows icon. If you would like to request these features to be added to Forms, I suggest you create two new tickets here in the forum using the "Suggest an Improvement" option. Describe what you would like to be able to accomplish, and our developers will evaluate your request. I can't promise they will decide to implement either, but that's the required first step.

As far as the "Add New" and "Delete" buttons on repeating image fields, those can be managed in WPML String Translation under the wpv-views text domain if you're using WPML, or if not you can add these code snippets in your child theme's functions.php file:

add_filter('toolset_button_delete_repetition_text', 'toolset_button_delete_repetition_text', 10, 2);
function toolset_button_delete_repetition_text($text, $config)
{
    return 'Your own custom delete text';
}

add_filter('toolset_button_add_repetition_text', 'toolset_button_add_repetition_text', 10, 2);
function toolset_button_add_repetition_text($text, $config)
{
    return 'Your own custom add new text';
}

Change the text as needed for each button.

#1103783

Thanks, I'll see what I can do with the existing solution for now but I suspect many would welcome a bit more control over this.
The changing of the button labels worked fine.