0vote

Search result

 

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

e107 version 2.1.5

Jimako commented May 11

Try to use search_template.php (copy core version to your theme)

3 Answers

0vote

ARTs Points12

 

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

tgtje commented May 11

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

0vote

ARTs Points12

 

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.

0vote

Jimako Points939
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'] ?

Please log in or register to answer this question.

Know someone who can answer? Share a link to this

...

e107 Q&A is a Question and Answer platform where e107 users can ask questions themselves and answer each others questions. By doing so users can earn badges and points and become e107 experts.

This community platform is a valuable tool for sharing and gaining knowledge on e107. Go ahead and find out yourself!

Connect with us