• Resolved lukiano880

    (@lukiano880)


    Hello.
    I would like to insert an image in the description of the field.
    I inserted the html tag “<img src=…” but the image is not displayed.
    Another solution could be to insert the image into an HTML field, but exclude it from notifications.

    Any suggestion?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @lukiano880

    I hope you are doing good today.

    In email notification do not use:
    {all_fields}
    and use separate tags for each field, which will simply allow you to skip the HTML field tag:
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#form-data

    Kind Regards,
    Kris

    Thread Starter lukiano880

    (@lukiano880)

    Thanks for the suggestion, but this do not work for me.
    Separate tags print the value but no the label.
    I have a few numeral fields which need the label in the email notification, so i have to type the label, but i dont want to send it if are empty.
    In example:
    Text_Label_1 : {number-1}
    Text_Label_2 : {number_2}
    If field number_1 is empty, the email will look like:
    Text_Label_1:
    Text_Label_2 : 4 (or whatever)

    I dont want the label if the field is empty.
    I think I’ll work with jQuery to insert images into each field.

    Thank you

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @lukiano880,

    Please try adding the following code using a mu plugin:

    add_filter( 'forminator_field_description_allowed_html', 'wpmudev_add_field_img_desc', 10, 3 );
    function wpmudev_add_field_img_desc( $allowed_tags, $description, $get_id ){
    	$allowed_tags['img'] = array(
    		'src'             => true,
    		'height'          => true,
    		'width'           => true,
    	);
    	return $allowed_tags;
    }

    It should allow the tag in the description of form fields. Please find more on how to add a mu-plugin here: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    I hope that helps.

    Kind Regards,
    Nebu John

    Thread Starter lukiano880

    (@lukiano880)

    It works.
    Thank you very much

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Image in field description’ is closed to new replies.