e107help.org Q&A
0 like 0 dislike


How to change the look of the result after a news search

e107 version 2.1.5
asked in Themes by (46 points) 3 5
Try to use search_template.php (copy core version to your theme)

3 Answers

0 like 0 dislike


In which file and in what order should I change the code. Should something change in search_template.php?

answered by (46 points) 3 5
as Jimako mentioned THAT file in your theme, do NOT touch or change the 'real' core file ( so only changes are made to the copied template. Please do note, that the changed template due to existance in THAT theme, only works in THAT theme. Should you change in time the theme, do so equal with the template.

Info : In case you wonder why copy : inside theme it overrides the core.... (core file may be changed with each update). SO in case there would be massive changes to it, than look inside it again if those changes should be made in your own changed file too. Success
0 like 0 dislike


Where do I need to edit the code in search_template.php? I want to get a picture of it after searching for the news.

answered by (46 points) 3 5
0 like 0 dislike
It's different question.  If I need something like this, I would do this:

- check in e_search.php in news plugin if there is some image, yes, it is: $res['image']

- look at actual code and see that that search results start with class search-results

- try to find where this is used - in search.php. After looking at code I would find that content is in variable $ps['text']  and it is from parsesearch method in search_handler.php  in e107_handlers

$res['image'] is not used at all there.  You can try to use $res['pre_title']  but it would require to change e_search.php file in news.

I write those  details because I can be wrong and there is some really simple way how to do it. In my opionion is not possible without changing core file. But why there is prepared $res['image'] ?
answered by (1.3k points) 7 52 62
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
744 questions
1,154 answers
1,179 users