- This topic has 1 reply, 2 voices, and was last updated 9 years, 8 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Custom content between filters?
I’m trying to add custom content between already generated filters. I have many multi selects and basically I wanted to separate those to “basic filters” and “advanced filters”. I’m trying to add some kind of “show/hide advanced filters” feature between my existing filters.
I’m aware of this link https://gist.github.com/rmorse/7b59b45a14b1ca179868 but I think it just changes fields and parameters. I don’t know how to add my own stuff before/after of that whole existing list item.
I guess it would be something like:
function filter_input_object($input_object, $sfid)
{
if (($input_object[‘name’] == ‘_sfm_product_manufacturer’))
{
// But I want to add custom stuff before/after that “product manufacturers” list item, not inside
}
}
add_filter(‘sf_input_object_pre’, ‘filter_input_object’, 10, 2);
So that I will end up like:
// My own stuf in here…
<li class=”example-class” data-sf-field-name=”example-name”>
// Or here…
You COULD do it, but it would be messy/hard to do.
Using this:
https://gist.github.com/rmorse/7b59b45a14b1ca179868
You can make the field accessible in the DOM and use jQuery to add content before or after. but, not ideal. A future version will much improve how you can modify the form.