• Resolved dpasserone

    (@dpasserone)


    Dear Developer

    I read with great interest the article

    https://contactform7.com/2015/02/27/using-values-from-a-form-tag/

    and I’m asking for help for including tags that already include the value taken from a TablePress cell:

    do_shortcode( ‘[table-cell id=10 cell=C3 /]’) allows to use the value in a php script, and I suppose something similar would be possible for a tag similar to the [currency] one,

    something like

    [datalist currency do_shortcode( ‘[table-cell id=10 cell=C3 /]’) ]

    In this way the tag [currency] can be used in the Email and the user becomes an Email with the value of that table cell.

    Can you point me to a hint for a solution?

    Thank you!

    Daniele

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dpasserone

    (@dpasserone)

    Hallo!
    I tried to proceed a bit further.

    I took the example from the webpage of “contactform7” (https://contactform7.com/2015/01/10/adding-a-custom-form-tag/ )

    add_action( 'wpcf7_init', 'custom_add_form_tag_clock' );
     
    function custom_add_form_tag_clock() {
        wpcf7_add_form_tag( 'clock', 'custom_clock_form_tag_handler' ); // "clock" is the type of the form-tag
    }
     
    function custom_clock_form_tag_handler( $tag ) {
        return date_i18n( get_option( 'time_format' ) );
    }

    then I replaced the “return date” command with the following

    return do_shortcode( '[table-cell id=7 cell=B9 /]' ); // corresponding cell in line B

    Which returns the content of a particular cell of a table.
    Specifying now [clock] in the form, shows the content of the cell.

    What I need now, is to assign this content to a form-tag (like a datalist), so to be able to include it directly in the Email. Something like

    [datalist clock B9] that assigns the content of the cell “B9” in a table to the attribute [clock], that I can then use in the Mail and in the extensions like “Convert CF7 to Pdf”.

    Thank you for any help on that!

    Thread Starter dpasserone

    (@dpasserone)

    Hi! Just want to say that I solved the problem by myself with the help of this example by morgyface

    https://gist.github.com/morgyface/56474f0a37abb7d622880daf6eff6e40

    and a bit of php string concatenation.
    So no answer here, too bad, but I can close the topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Tag’ is closed to new replies.