Hi,
Thank you for contacting us and I'd be happy to assist.
The gallery shortcode that you're using in your content template requires image IDs to work, whereas, in Toolset's image type fields, the image's URL is saved and not the IDs.
To make this work, you'll need a custom shortcode, that can get the image URLs from the field and then return their respective image IDs.
The following code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
function get_image_ids_from_field_func( $atts )
{
$a = shortcode_atts( array(
'field' => '',
'separator' => ','
), $atts );
$field_value = types_render_field( $a['field'], array( "output" => "raw", "separator" => $a['separator'] ) );
if(!empty($field_value)) {
$field_value_arr = explode($a['separator'], $field_value);
foreach ($field_value_arr as $field_value_item) {
$image_ids[] = attachment_url_to_postid( $field_value_item );
}
if( !empty($image_ids) ) {
$image_ids_str = implode($a['separator'], $image_ids);
return $image_ids_str;
}
}
}
add_shortcode( 'get_image_ids_from_field', 'get_image_ids_from_field_func' );
Next, please add "get_image_ids_from_field" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.
After that, you'll be able to use this new shortcode, within your gallery shortcode, like this:
[gallery type="rectangle" ids="[get_image_ids_from_field field='gallery-photo' separator=',']"]
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar