The forums are closed and will be removed when we launch our new site.
Looking for support? You can access the support system via your account.
-
AuthorSearch Results
-
January 20, 2021 at 4:19 pm #273339
Jonathan AppletonParticipantThis reply has been marked as private.January 18, 2021 at 12:23 pm #273073
Kamil SawońParticipantFor feature:
<button class="mobile-menu-accordion" id="mobile-accordion-button" onclick="switchAccordion()">rozwiń filtry</button> <div id="mobile-menu-panel"> <span id="ST">[searchandfilter id="4911"]</span> </div> <script> function addListenerToSearchAndFilter(){ var elements = document.getElementsByClassName("sf-label-radio"); for (var i = 0; i < elements.length; i++) { elements[i].addEventListener('click', switchAccordionAfterClick, false); } } function switchAccordion(){ var x = document.getElementById("mobile-menu-panel"); var y = document.getElementById("mobile-accordion-button"); if (x.style.display === "none") { x.style.display = "block"; y.innerHTML = "zwiń filtry"; } else { x.style.display = "none"; y.innerHTML = "rozwiń filtry"; } addListenerToSearchAndFilter(); } function switchAccordionAfterClick (){ var x = document.getElementById("mobile-menu-panel"); var y = document.getElementById("mobile-accordion-button"); x.style.display = "none"; y.innerHTML = "rozwiń filtry"; } </script>
This code works well, however I would like to do one more thing. I would like to get name of the chosen filter to display. So now, the point is to find the way to get element label text
January 18, 2021 at 12:01 pm #273065
Kamil SawońParticipantThank You
Update – This code works, but only once. looks like afer use s&f resets my event listener<button class="mobile-menu-accordion" id="mobile-accordion-button" onclick="switchAccordion()">rozwiń filtry</button> <div id="mobile-menu-panel"> <span id="ST">[searchandfilter id="4911"]</span> </div> <script> function switchAccordion(){ var x = document.getElementById("mobile-menu-panel"); var y = document.getElementById("mobile-accordion-button"); if (x.style.display === "none") { x.style.display = "block"; y.innerHTML = "zwiń filtry"; } else { x.style.display = "none"; y.innerHTML = "rozwiń filtry"; } } var elements = document.getElementsByClassName("sf-label-radio"); function switchAccordionAfterClick (){ if (window.screen.width < 757){ var x = document.getElementById("mobile-menu-panel"); var y = document.getElementById("mobile-accordion-button"); x.style.display = "none"; y.innerHTML = "rozwiń filtry"; } } for (var i = 0; i < elements.length; i++) { elements[i].addEventListener('click', switchAccordionAfterClick, false); } </script> Array.from(elements).forEach(function(element) { element.addEventListener('click', switchAccordionAfterClick); });
January 18, 2021 at 10:42 am #273044
Kamil SawońParticipantThere is a code:
<button class="mobile-menu-accordion" onclick="switchAccordion()">rozwiń filtry</button> <div id="mobile-menu-panel"> <span id="ST">[searchandfilter id="4911"]</span> </div> <script> function switchAccordion(){ var x = document.getElementById("mobile-menu-panel"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } } function switchAccordionAfterClick (){ if (window.screen.width < 757){ var x = document.getElementById("mobile-menu-panel"); x.style.display = "none"; } } document.querySelector('.sf-label-radio').addEventListener('click', switchAccordionAfterClick) </script>
January 15, 2021 at 3:51 pm #272935In reply to: Button filters
Alessandro EpisParticipantThis reply has been marked as private.January 13, 2021 at 2:35 pm #272672In reply to: Mobile Results
Lindsey SiehdaParticipantThere is no lazy loading, but I found the issue. For whatever reason the filtered results columns are losing styles, the columns are not resizing to 100% for mobile so there is not enough room to display the content with the padding. Not sure if this is my theme or the plugin, but I’m using WP Bakery Default Post Grid with 3 columns. I can fix this using css. Thanks!
January 12, 2021 at 3:07 pm #272506In reply to: Results on same page – wordpress salient
TrevorModeratorIn my example, the Category filter? If the form is set correctly, our cache will populate that list from the terms you have used in the posts.
I would point out that there are a number of pre-made card layout styles (templates) for that grid, I just made a simple one for myself (the first one on this list):
January 11, 2021 at 4:52 pm #272388In reply to: I hope for help.
TrevorModeratorYou would need to apply custom CSS to the form to suit your precise needs. There are many CSS snippets on our forum:
https://support.searchandfilter.com/forums/search/data+form+sf+id+searchandfilter
I do sometimes provide these, if I have the available time (but I am rather busy at the moment, sorry).
For example, to find snippets for the search field, which has the class name
sf-field-search
, this search should give you posts that style that field:https://support.searchandfilter.com/forums/search/data+form+sf+id+searchandfilter+sf-field-search/
Rounder corners are set with the CSS border-radius attribute.
January 11, 2021 at 11:42 am #272324In reply to: Filter without a (visible) form
Richard HartleyParticipantThis reply has been marked as private.January 7, 2021 at 10:05 am #271871In reply to: Show only specific taxonomies
Arthur MayrParticipantThis reply has been marked as private. -
AuthorSearch Results