• At the moment, the following html code is output:

    <div data-id=”group-653″ data-orig_data_id=”group-653″ data-class=”wpcf7cf_group” class=”” style=”display: block;”>

    So I output a block with style= “display:block;”

    https://joxi.ru/J2bbjEtVa1kP26

    So I output a block with style= “display:contents;”

    https://joxi.ru/8AndjDUyvEbPmO

    How do I add my class to this DIV wrapper ? How to replace style= ” display:block” ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter danilk

    (@danilk)

    In general, I added the style in the file cf7cf.php on line 413, everything works. The only thing I didn’t understand was where the display: block is formed. But it’s probably not necessary and it works like that.

    Plugin Author Jules Colle

    (@jules-colle)

    display block is added by the jQuery.show() function, which is used to display the block.

    Note that adding the styles straight in the plugin file is probably not the best idea, because you will loose these changes when you update the plugin.

    A work-around that I use is to add a div with a class around your group.

    <div class="myclass">[group g] your other stuff here [/group]</div>

    Then you can target the group with CSS like this:

    .myclass > div { background-color: yellow; }

    Or even easier without the additional DIV, just use:

    [data-id="group-653"] { background: yellow; }

    That being said, adding a class to a group is something that is in the pipeline for a future update. https://github.com/pwkip/contact-form-7-conditional-fields/issues/14

    • This reply was modified 3 years, 8 months ago by Jules Colle.
    • This reply was modified 3 years, 8 months ago by Jules Colle.
    Thread Starter danilk

    (@danilk)

    Спасибо за ответ, я нашел в script.js

    if ($group.css('display') === 'none' && !$group.hasClass('wpcf7cf-hidden'))

    (‘display’) replace with (‘display’, ‘contects’)

    Everything worked out, but when you select any select item in the contact form, everything works, but how would you explain it, blinks, blinks :))) And why am I asking all this I have a website on boostrap, I need this display:block is like a lump in your throat and you can’t finish writing your own styles….

    The ability to add your own style for the wrapper is very necessary, now you will have to cringe and finish off the styles… And so I would insert bootstrap styles and everything, the work would be significantly accelerated. I hope this will appear soon.

    • This reply was modified 3 years, 8 months ago by danilk.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I add my own styles to the div group html wrapper ?’ is closed to new replies.