• Resolved DonF

    (@lenglemetz)


    Hi!

    I am looking to reproduce the select of “Votre besoin” of this page, https://www.adf-assurances.fr/assurance-loisirs “Section DEMANDEZ VOTRE DEVIS PERSONNALISé ET GRATUIT”.
    The type of menu select submenu with sections in bold. Have you any idea how? How to get “Assurance de personne” fat and not clickable?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi lenglemetz,

    to do this you will need to create a custom type in a function/plugin file

    add_action( ‘wpcf7_init’, ‘wpcf7_add_shortcode_drop’ );

    then create a function which creates the shortcode

    **
    * Add cf7 shortcode builder callup function
    */
    function wpcf7_add_shortcode_drop() {
    wpcf7_add_shortcode( ‘drop’, ‘wpcf7_drop_shortcode_handler’, true );
    }

    finally you can create the function which generates the dropdown in html

    function wpcf7_hide_shortcode_handler( $tag ) {
    $tag = new WPCF7_Shortcode( $tag );
    $id = get_the_ID();
    $location = get_the_title();
    $html = ‘<select required=”required” class=”form-control form-select required” id=”edit-submitted-besoin” name=”submitted[besoin]”>
    <option value=”” selected=”selected”>– Choisir –</option>
    <optgroup label=”Assurances de personnes”>
    <option value=”Mutuelle sante”>Mutuelle santé</option>
    <option value=”Prevoyance”>Prévoyance</option>
    <option value=”Dependance”>Dépendance</option>
    <option value=”Obseques”>Obsèques</option>
    <option value=”Assurance Vie”>Assurance Vie</option>
    </optgroup>

    </select>’;

    return $html;
    }

    this should help get you going, I cut and pasted part of the menu you wish to recreate, obviously you will need to get this data dynamically.

    Thread Starter DonF

    (@lenglemetz)

    Hi,

    Thank you for your help, the menu works ??

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