Search Issue
-
Hi again Yannick:
I’m having an issue with the search tool/feature in Link Libarary…I have links that are assigned to numerous categories and if that link is selected based on the search criteria the link shows up many times (once for each category it is associated with)…is there any way to prevent this from happening and have the link only show up once in the search results?
Thanks!
Matt
-
Just following up on this post…any thoughts?
Thanks,
Matt
Hi Matt, Sorry for the lack of response. Preoccupied with an upcoming work trip to Asia.
Can you educate me a bit more on your use of Link Library. Are you placing links in multiple categories so that they should up on different pages, or within different categories on a full page, but would then want them to appear only once when you run a search?
I could add an option only to combine results on search page, instead of being a general option only for link display. That being said, I don’t I will be able to get to this until early June when I come back from travel.
No problem Yannick, thanks for the reply now…
Yes, I have links that are in multiple categories so that they show up when someone selects any of the categories that it would relate to…
You can see what I mean on my site:
http://www.avobs.com/links-reference/
If you try typing something like “opt” in the search field, you will see that each match is listed multiple times since it is in multiple categories. I need them to only be listed once…
If you have another idea how to better deal with this I’m certainly open to suggestions, but I can’t think of a better way to handle what I need.
I hope you have a good trip…
Thanks,
Matt
I had the same problem and I found out that search results get filtered by the categories to be displayed setting.
So, you create a category just for that purpose (or maybe you can use your “all links” category), put its ID in the categories to be displayed field, and add all/any links you want, and now they are filtered through that search category.
Now your [ link-library-cats settings=x ] will also display only that category in your list of categories, which I think is not what you want. To correct this use [ link-library-cats categorylistoverride=”2,15,8,4,5″ ] ie. with a comma seperated list of your category ID’s. Hint: the order of ID’s will also be used by the library settings > categories > result order option “based on included category list”.
Last thing you may like to do is prevent showing the category name in the search results. I think there’s a new option to prevent this, but you can also hide it eg. using CSS sibling combinator:
.resulttitle + .LinkLibraryCat .linklistcatname { display: none; }This is exactly how I’ve set it up on my travel agents page in ajax mode. Let me know if you have any questions.
EDIT: this works because link library will still show the links when clicking on a category, but filters via search. Not sure if that’s a feature, and not yet tested with the latest version, but it has been working great for at least 18 months. Currently running on v5.9.4
Thanks for the suggestion yezzz…I’m not sure I follow what you are saying (I’m pretty new at this), but I’ll play with it a bit. In taking a quick look at you page, I think the difference is that I want to have the option to have both the categories selectable via the drop down box AND the search…
Not sure if I’m making sense, but you can see what I mean on my site:
http://www.avobs.com/links-reference/
Thanks again for you thoughts!
Matt
Yes, I think I understand what you mean, and the method above should gives you what you want. The categorylistoverride with all your category ID’s as comma-seperated list should display the dropdown with all the categories, just like the regular link-library-cats shortcode.
The other setup stuff is for filtering search results via a single category (eg. your “all links” category). It acts as an output filter, ie. it returns all links that match the search query, but it only displays them as results for the “all links” category.
The css I use is just for hiding the “all links” category name when displayed under the resulttitle (but I see you have that hidden).
Note that when you add the links to the “all links” category, you do not remove them from the other categories. Looks like you already have it set up like that, so all you need to do is put the “all links” id in the categories to be displayed setting, and set up your categorylistoverride.
Btw, I do have my categories and search like I think how you want them. The categories are in the accordion in the sidebar (or under the search box for smaller screens). I have split up my categories in groups. Most are in a list, some are in a dropdown. Clicking or selecting them will display the category links as usual.
The search also returns results from all links, filtered via “alle-aanbieders” category, with hidden category name. Don’t mind the autosuggest I’ve added, that’s a whole new story….
Hi again yezzz…
I finally had time to give this a a shot and your trick appears to be working 🙂
Thanks for the help!
All the best,
Matt
Now my only remaining issue / request is that there doesn’t appear to be any good way to clear the search term once the search is performed.
If a search is performed it works perfectly…afterwards if you select a category it displays all the links in that category, however if you refresh the page, the previous search term is applied again…this is evident in the address bar of the browser.
It would be great to have some kind of “Clear Search” button available that would remove the search parameters.
Also, I would think it could be helpful if the search term remains in the search box until it is cleared…currently as soon as you hit the search button the input field return to the word “search” which I think is confusing since there is a filter applied at the time…
Thanks again,
Matt
Hey you’re welcome. Neat huh?
Re the search term clearing: I don’t see that happening here. What browser are you using?
Re the search parameters: the search is currently only via http with url parameters. Great for search initiated from another page, but on-page search results via ajax is on my wishlist too 😉
Btw, weren’t you first showing your links per category (in seperate blocks) on pageload? Want that restored too, or is it how you wanted it? Same for the category selection in the submit link form.
I guess then you can setup a 2nd library without the categories to be displayed restriction, and use that one for displaying categories, link submit etc.
So then you’d use something like:
[ link-library-cats settings=2 ]
[ link-library-search settings=1 ]
[ link-library ]
[ link-library-addlink settings=2 ]
The topic ‘Search Issue’ is closed to new replies.