-
AuthorPosts
-
April 12, 2011 at 11:14 am #162689
Hi Thuan,
Is is possible to show extra fields in the search result page. Default parameters is enabled, but it doesn’t show. Also I would like to have one field instead of all the extra fields.
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
April 13, 2011 at 11:19 am #386158You can show extra fields in the search result page. Please follow my suggestion bellow:
Change SQL query of onSearch function to get fields what you need to display on result page
<blockquote>plugins/search/jak2_filter/tmpl/jak2_filter.php</blockquote>
April 18, 2011 at 3:01 pm #386938Hi Tamlm,
Thanks for your replay.
Can you give me a hint how to do.
The extra field is named “Number”.April 19, 2011 at 2:43 pm #387105There is no onSearch in this file. I need more instructions.
Please could you have a look into this.May 4, 2011 at 1:09 pm #389805I really can not figure this one out.
Please help me on this.May 9, 2011 at 11:13 am #390405Hello, you can choose a position (for exemple content1) and modify your template so as to load it.
May 12, 2011 at 1:14 pm #390969Thanks for your replay but I don’t know what you mean.
So still no solution that will work for me. I need more directions.thangnn1510 Friendthangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
May 17, 2011 at 2:46 am #391527K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.
xiondesigns Friendxiondesigns
- Join date:
- May 2010
- Posts:
- 70
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 23, 2011 at 10:17 pm #398120<em>@thangnn1510 240815 wrote:</em><blockquote>K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.</blockquote>
I think what we need (and want) is a guide on how to show some extra fields (specific ones) on the results page.
The same way we can customize to show the k2 image on the results page modifyng default_results.php, i would love some guidance on how to get some extra fields.
In k2 for example i can do this (in a template)
<?php $custom = $this->item->extra_fields; ?>
<?php echo $custom[2]->name; ?>
<?php echo $custom[2]->value; ?>And i can add style to all this. But i cant figure out how to do the same with Ja K2 Search module results on the Joomla search component.
Bye
xiondesigns Friendxiondesigns
- Join date:
- May 2010
- Posts:
- 70
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 24, 2011 at 12:20 pm #398240Please i need help with this.
thangnn1510 Friendthangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
June 25, 2011 at 2:10 am #398310<blockquote>K2 extra fields are set in back-end and will be displayed in front end within JA K2 filter modules. It only displays in module, we can’t customize it to display in result pages.</blockquote>
Please read my earlier response. Thanks.
xiondesigns Friendxiondesigns
- Join date:
- May 2010
- Posts:
- 70
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
June 28, 2011 at 3:10 am #398753There should be some way to show extra fields the same way i can add the image… come on!
Its not right if we try to create complex filtering without being able to show some of that specific data con the search result.
There has to be some way, and i beg for some developer to help on this.
There has to be a way
P L E A S E
thangnn1510 Friendthangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
June 29, 2011 at 8:41 am #399049OK Then, This is your custom code. Please put it to templates/your_template/html/com_search/search/default_result.php about line 33
<?php
$db = &JFactory::getDBO();
$query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
$db->setQuery($query);
$items = $db->loadObjectList();
if(count($items)>0){
foreach($items as $item){
$item = json_decode($item->extra_fields);
echo $item[0]->value;
}
}
?>change echo $item[0]->value; with yours. Thanks.
2 users say Thank You to thangnn1510 for this useful post
June 30, 2011 at 8:36 am #399305Hi Thang,
This works great.
Thanks for you help, you’re a hero!Regards, Perry
xiondesigns Friendxiondesigns
- Join date:
- May 2010
- Posts:
- 70
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
July 5, 2011 at 5:52 pm #399989When adding
<?php
$db = &JFactory::getDBO();
$query = “SELECT * FROM #__k2_items WHERE id=”.$result->id;
$db->setQuery($query);
$items = $db->loadObjectList();
if(count($items)>0){
foreach($items as $item){
$item = json_decode($item->extra_fields);
echo $item[9]->value;
}
}
?>It works. But it it is a “multipleSelect” it gives an “array” result, instead of the actual value.
Bye
-
AuthorPosts
This topic contains 35 replies, has 8 voices, and was last updated by espertoseo 13 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum