Forums › Forums › Search & Filter Pro › Results Page – Can tag URLs evoke Ajax load/refresh of page results?
- This topic has 9 replies, 3 voices, and was last updated 4 years, 4 months ago by Anonymous.
-
Anonymous(Private) July 4, 2020 at 9:42 am #251386
Hi Guys.
I have s Search Filter form where I am displaying posts in a list.
Ajax is enabled.I am listing tags with Search Filter URLs prepended within each post that’s listed.
eg: /?_sft_tag_technologies=healthIs it possible to have the tags hook into the Ajax refreshing of results?
Will send URL to demo site privately.
Trevor(Private) July 6, 2020 at 2:30 pm #251499Sorry, I would have gotten to your thread earlier, but by bumping it you placed it further down my list (I work oldest last touched first). Your first two posts arrived here while we were closed for the weekend.
You want the tag term names listed in the posts themselves to be able to trigger the Ajax of our form? I am sorry, but I do not think that is possible directly. I think the links would have to send to a custom javascript that would then receive the tag name, set that in our form and then trigger a submit of the form.
Ross Moderator(Private) July 7, 2020 at 11:36 am #251675Hi Trent
I’m having a little trouble following your question:
I am listing tags with Search Filter URLs prepended within each post that’s listed.
eg: /?_sft_tag_technologies=healthCan you be more specific? I don’t see any links on that page just a search form + results?
Thanks
Ross Moderator(Private) July 7, 2020 at 1:40 pm #251744Hi Trent
Thanks for the video, makes perfect sense.
Right now there is no easy way to do this, we have a very limited JavaScript API… but it will be good to add support for this, so tagging it for version 3…
You could achieve what you wanted though, but through a fair a bit of custom JavaScript.
The logic would be:
1) Leave your URLs exactly as they are, they will be good for SEO, and proper links through to the results in the event JS doesn’t work
2) using JS, hook into theonclick
of your category links
3) grab the value directly from thehref
of your anchor tag, or add adata-attribute
with the category value only (so you don’t have to parse the string)
4) set the value of your category field to the new value, radios are annoying to set, but you can do like this example
5) then submit our form –$('.searchandfilter').submit()
– if ajax is enabled, the submit will be an ajax request.I’m afraid its a bit cumbersome right now, a proper JS API will be coming.
Thanks
-
AuthorPosts