• I noticed when no filter is selected my html code still has <div class=”bapf_sfilter”>.

    If this is disabled in the settings, it will add the display: none;

    I don’t want to use css to hide it. I want to remove all html code added by plugin

    I want to remove all this code from my site with no filter selected. It only appears when I select the filter.

    <div class="bapf_sfilter"><div class="bapf_head"><h3></h3></div><div class="bapf_body"><div class="berocket_aapf_widget_selected_area">Nothing is selected</div></div></div>

    Is there any way to do that. Thank you !

    • This topic was modified 2 years, 3 months ago by Laptop Titan.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi,

    We need to know the location where to show selected filters. That html cannot be removed.

    Regards,
    Dmytro

    Thread Starter Laptop Titan

    (@laptoptitan)

    So if it can’t be deleted, how do I add a new class instead of style=”display:none”

    Original code:

    <div class="bapf_sfilter bapf_divi_sfa bapf_sfa_mt_hide" style="display: none;"><div class="bapf_body"><div class="berocket_aapf_widget_selected_area">Nothing is selected</div></div></div>

    I want like this there is no filter selected

    <div class="bapf_sfilter bapf_sfa_mt_hide"><div class="bapf_body"><div class="berocket_aapf_widget_selected_area">Nothing is selected</div></div></div>

    And when selected it will look like this

    <div class="bapf_sfilter"><div class="bapf_body"><div class="berocket_aapf_widget_selected_area">Nothing is selected</div></div></div>

    • This reply was modified 2 years, 3 months ago by Laptop Titan.
    Plugin Author RazyRx

    (@razyrx)

    Hello,

    Plugin use class bapf_divi_sfa to style selected filters area, you can change style to default Selected Filters Area, then it will be not used.

    Class bapf_sfa_mt_hide uses do detect that this selected filters area must be hidden when empty, it can be removed when option Show if nothing is selected enabled on filter edit page.

    If you need to set class or change something when plugin detect Selected filters then use JavaScript hooks that our plugin has
    default_selected_filters_area_full_exist – when selected filters exist
    default_selected_filters_area_full_notexist – no selected filter
    Example:

    customfunc__default_selected_filters_area_full_exist = function(html) {
        //PLACE NEEDED CODE THERE
        return html;
    }
    if ( typeof(berocket_add_filter) == 'function' ) {
        berocket_add_filter('default_selected_filters_area_full_exist', customfunc__default_selected_filters_area_full_exist );
    } else {
        jQuery(document).on('berocket_hooks_ready', function() {
            berocket_add_filter('default_selected_filters_area_full_exist', customfunc__default_selected_filters_area_full_exist );
        });
    }

    Regards,
    Oleg

    Thread Starter Laptop Titan

    (@laptoptitan)

    Thanks for the thoughtful reply.

    I understand your explanation. But it seems like mission impossible for me. I’m not good at coding.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to remove html code by plugin when no filter is selected’ is closed to new replies.