- Posts: 6
COMMUNITY FORUM
Extra fields in search results
- Evert Bal
-
Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Viktoria Sab
-
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- Evert Bal
-
Topic Author
- Offline
- New Member
- Posts: 6
I didn't found a solution for K2. So I switched to mosets' Hot Property.
Please Log in or Create an account to join the conversation.
- Daniel Arnolf
-
- Offline
- New Member
- Posts: 6
Something came up, check this module: labs.smartwebstudio.com/ , it does the job but it is a separated search module, just to search a single category, child categories, a chosen extra field etc, it even have other options like select box to filter by a determined item into a drop down extra field, which will avoid tags for filtering results.
You can use various instances of the module in same page to search and select by different criteria.
It outputs the filtered result through generic.php, which is a drawback since you can only override once, and affect the output of tags and author at the same time. I'm waiting for an answer from the developer to see if is possible to get the results assigned to a custom template override, and avoid changing the generic.php.
Another thing to notice, is that to get it to work, you may have to do a few slight changes to the K2 core files, the author provides the needed override, as well as the backup to restore the original core files.
Hope it helps.
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
Instead of using generic.php, it could be routed to use the item.php instead, but with these things, it would require a few hours coding to implement such a thing.
Not sure which search module your using, but the K2 search uses joomla search and that picks up K2 items and categories, so it should be possible to include a template over ride to allow search by extra field data, as its just a DB query, easy stuff ;)
I can recommend some "trusted" coders which I know can handle the k2 code, but it is worth noting that you would most likely have to cross some palms with silver.
If, there are several users that require this kind of function, then that would make it more viable.
Lets keep this open and see what we can come up with.
Regards,
Simon
K2 Support
Please Log in or Create an account to join the conversation.
- Daniel Arnolf
-
- Offline
- New Member
- Posts: 6
I will really appreciate if you can connect me to a Joomla - K2 coder to solve this issue.
Here is the some information on the module I'm using: labs.smartwebstudio.com/ , it does exactly what I need, it searches and filters extra fields contents.
Since I'm trying to create a kind of phonebook with about 13 extra fields, no content or images, I want to override the output to display a table, but I won't actually have an item.php view, just the category_item.php will do. The only thing stopping me is the fact that the module outputs through generic.php, if I can route it to print trough a custom template, I'm done.
I apologize to the members of the discussion if I get out of context with my comment, but I found no way to contact Simon directly.
Thank you very much.
Daniel Arnolf
Please Log in or Create an account to join the conversation.
- Dragan Todorovic
-
- Offline
- New Member
- Posts: 14
<?php
$custom = json_decode($item->extra_fields);
$first_xfield = $custom[0]->value[1];
?>
<?php echo $first_xfield ?>
to find all
do
print_r ( $custom);
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
I want my search results to have the snippet of text with the highlighted keyword(s) for content that is in extra fields. Currently it is returning the matching item but not with any snippet text even though it is there.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
Could you explain how I would resolve this? As far as I can tell K2 items are being returned in the search but with empty paragraph tags where the snippet should be.
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
I've just realized that I am not actually using K2 search but Joomla Search module.
It's working fine and returning the K2 items but just not returning anything from the extra fields for the snippet.
Would you still like to see a URL?
Is there any fix for the Joomla core code that would resolve this?
Thanks
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
So it maybe because of template, maybe not.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Check if your template use override for com_search. And try to rename that folder temporary.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
How old is your Joomla version ?
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
Joomla version is 1.5.23
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
Or am I not understanding you correctly?
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Maybe it is not possible yet in K2. That commercial search module use some plugin for indexing of extra fields.
Please Log in or Create an account to join the conversation.