Thanks for your reply, Myron. You are right that the $ is not correct in this place.
But after I deletet the $, it still doesn't work, there is no TEST displayed in my search results. I'm not sure if I implemented the code for the
SEARCH_RESULT_FULLPAGE-hook correctly. Does anybody has another idea what could be wrong in my code?
EDIT: I took a look at the watchcycle-plugin, which does something similar to the plugin I want to create. What I don't understand: I believe I use nearly the same code as the watchcycle-plugin does as can be seen at the bottom of this file:
https://github.com/cosmocode/dokuwiki-plugin-watchcycle/blob/master/action.php - but in contrast to this plugin, my plugin doesn't work.
I tried also if my way works on the
SEARCH_RESULT_PAGELOOKUP-hook, which is used for search results when the search term is found in the page name - but this also doesn't work. My code is now:
<?php
if (!defined('DOKU_INC')) {
die();
}
class action_plugin_nsiconinsearch extends DokuWiki_Action_Plugin
{
public function register(Doku_Event_Handler $controller)
{
$controller->register_hook('SEARCH_RESULT_PAGELOOKUP', 'BEFORE', $this, 'handle_search_result_pagelookup');
$controller->register_hook('SEARCH_RESULT_FULLPAGE', 'BEFORE', $this, 'handle_search_result_fullpage');
}
public function handle_search_result_pagelookup(Doku_Event $event, $param)
{
$icon = "<p>TEST</p>";
$event->data['listItemContent'][] = $icon;
}
public function handle_search_result_fullpage(Doku_Event $event, $param)
{
$icon = "<p>TEST</p>";
$event->data['resultHeader'][] = $icon;
}
}
I've no clue what I can do now.