HACK: Search plugin: custom fields in search results

Post Reply
ctuxboy
Ssr. Bludit
Posts: 25
Joined: Sat Dec 15, 2018 11:37 pm
Has thanked: 4 times
Been thanked: 2 times

Hello,

Found a solution how can searching also custom fields.
Adding this code in ../search/plugin.php (below line 209):

Code: Select all

$cache[$pageKey]['CUSTOM-FIELD'] = $page->custom('CUSTOM-FIELD');
Replace CUSTOM-FIELD with the name from your custom-field, (only useful for string-type custom fields).
search-custom-field.png
search-custom-field.png (111.57 KiB) Viewed 8893 times
Post Reply