Keyword

Have search include categories & cat. descriptions

More
12 years 1 month ago #101935 by AD
I'm loving K2 and I'm using it as a business directory, but have 1 problem. My site search is not searching the category or category description fields. Since I'm using each business department as a category (employees are the items), having them show up in the search is critical. Anybody know how to have this included in the search or a plugin/workaround that can accomplish this? Thanks in advance!

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #101936 by AD
For anyone trying to do this - I figured out a way to get it done without any custom programming. It's a workaround, for sure, but depending on how many categories you have, not too bad.

Here's what to do:
1. Determine the URL for the Category you want to have searched and have the search results display (in this example, we can use www.domain.com/desired-category)
2. Download and install Joomla extension ReDJ (or any redirection extension, this is the one I used though). You have to enable the plugin for this to work as well even though the component shows up automatically.
3. Create a Joomla article category called Redirects (or something like that, again, I'm just detailing how I did mine, which isn't necessarily the best way, but it works).
4. Go to an existing K2 category description, copy all of the text, then create a new article (I called mine test article) in the Redirects category with the same name as your category and paste the text from the category description into the body of the article.
5. Get the URL for the article (to do this I created a menu item, linked it to the category Redirects, clicked on this new menu item, then clicked on the article I just created, and copied the URL from the browser).
6. Create the redirect in the ReDJ component. If my article URL was www.domain.com/123-test-article then I would make the From URL field be (without quotes) "/123-test-article/*" and the to URL field would be (without quotes) "/desired-category"
7. What will happen now when you search, the search will display the redirect article you created, which will show the category description, then when you click on it, the redirection will happen and the category itself will be displayed.
8. All set - should work. Had I seen this a couple weeks ago, I'd have saved myself more hours banging my head against a wall than I can count (needless to say also time spent looking for other components/plugins that would do this). Hope it helps!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum