- Posts: 26
COMMUNITY FORUM
Images in search results
- Mark Foster
- Topic Author
- Offline
- Junior Member
Less
More
13 years 8 months ago #93509
by Mark Foster
Images in search results was created by Mark Foster
Been googling for ages to try and find something
Is there any way or hack that I can implement so that images can be shown in search results
It's critical for a properties site that I am making
Please help!
Kind regards
Mark
Is there any way or hack that I can implement so that images can be shown in search results
It's critical for a properties site that I am making
Please help!
Kind regards
Mark
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 8 months ago #93510
by BBC
Replied by BBC on topic Images in search results
mod_k2_tools, set "Search" and try to style it as you want.
How many columns do you want ? Intro, just Title ? Something else ?
How many columns do you want ? Intro, just Title ? Something else ?
Please Log in or Create an account to join the conversation.
- Mark Foster
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
13 years 8 months ago #93511
by Mark Foster
Replied by Mark Foster on topic Images in search results
Hi, thanks for reply
Sorry I should said, I'm using the extra fields search from Joomlart as I need to to be able to offer drop down choices as well otherwise I would have used the k2 tools one
Site is here
www.farmhousesaleslemarcheitaly.co.uk/
If you set province in the search to Fermo, then 2 results are returned, I need to be able to display the images next to them.
Mamy thanks
Mark
Sorry I should said, I'm using the extra fields search from Joomlart as I need to to be able to offer drop down choices as well otherwise I would have used the k2 tools one
Site is here
www.farmhousesaleslemarcheitaly.co.uk/
If you set province in the search to Fermo, then 2 results are returned, I need to be able to display the images next to them.
Mamy thanks
Mark
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 8 months ago #93512
by BBC
Replied by BBC on topic Images in search results
Do you testing something ?
There are some image frames.
There are some image frames.
Please Log in or Create an account to join the conversation.
- Mark Foster
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
13 years 8 months ago #93513
by Mark Foster
Replied by Mark Foster on topic Images in search results
Yeah I tried a hack from the joomlart forums.
Which modded the default_results.php file in com_search and added this
<img src="<?php echo $result->image; ?>" alt="<?php echo $result->title; ?>" title="<?php echo $result->title;?>" width="100px" height="100px"/>
the result class is empty though and isn't returning an image though
I guess this is all means getting further into how K2 and the standard Joomla search work together
Thanks
Mark
BBC said:
Do you testing something ?
There are some image frames.
Which modded the default_results.php file in com_search and added this
<img src="<?php echo $result->image; ?>" alt="<?php echo $result->title; ?>" title="<?php echo $result->title;?>" width="100px" height="100px"/>
the result class is empty though and isn't returning an image though
I guess this is all means getting further into how K2 and the standard Joomla search work together
Thanks
Mark
BBC said:
Do you testing something ?
There are some image frames.
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 8 months ago #93514
by BBC
Replied by BBC on topic Images in search results
As i see it in K2 settings, images in search listings are supported.
Fast, not as you want it, in Joomla com_search.
But, i cannot get images to show in search listing.
Fast, not as you want it, in Joomla com_search.
But, i cannot get images to show in search listing.
Please Log in or Create an account to join the conversation.
- jjozsika
- Offline
- New Member
Less
More
- Posts: 6
13 years 7 months ago #93515
by jjozsika
Replied by jjozsika on topic Images in search results
Hello! i've found a solution:
You have the search mod which is searching in the table.
Located: plugins/search/jak2_filter.php
It has the SQL query with binary search, you have to add the id field to the selected list:
In the 231. line oyou have to add the id field name:
$query = " SELECT i.id, i.title, i.metadesc,
Now, you can go and edit the result lister tamplate:
/templates/gk_mystore/html/com_search/search/default_results.php
After the result cycle,
<?php foreach ($this->results as $result) : ?>
You can add the image generation based pn the id and md5() hash:
<?php $row = './media/k2/items/cache/'.md5("Image".$result->id).'_S.jpg'; if(file_exists($row)) echo "<img src=\"$row\">";?>
And woala, the images right there!
regards, jjozsi
You have the search mod which is searching in the table.
Located: plugins/search/jak2_filter.php
It has the SQL query with binary search, you have to add the id field to the selected list:
In the 231. line oyou have to add the id field name:
$query = " SELECT i.id, i.title, i.metadesc,
Now, you can go and edit the result lister tamplate:
/templates/gk_mystore/html/com_search/search/default_results.php
After the result cycle,
<?php foreach ($this->results as $result) : ?>
You can add the image generation based pn the id and md5() hash:
<?php $row = './media/k2/items/cache/'.md5("Image".$result->id).'_S.jpg'; if(file_exists($row)) echo "<img src=\"$row\">";?>
And woala, the images right there!
regards, jjozsi
Please Log in or Create an account to join the conversation.
- Mark Foster
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
13 years 7 months ago #93516
by Mark Foster
Replied by Mark Foster on topic Images in search results
Will try that now and let you know!
Thanks
Mark
Thanks
Mark
Please Log in or Create an account to join the conversation.
- jjozsika
- Offline
- New Member
Less
More
- Posts: 6
13 years 7 months ago #93517
by jjozsika
Replied by jjozsika on topic Images in search results
Make some backups of your files :)
Mark Foster said:
Will try that now and let you know!
Thanks
Mark
Mark Foster said:
Will try that now and let you know!
Thanks
Mark
Please Log in or Create an account to join the conversation.
- Mark Foster
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
13 years 7 months ago #93518
by Mark Foster
Replied by Mark Foster on topic Images in search results
You are a star :)
Works great, been waiting weeks to find a solution to that :)
Thank you so much
Works great, been waiting weeks to find a solution to that :)
Thank you so much
Please Log in or Create an account to join the conversation.