Hello,
I'm writing a plugin that pull data from database tables into DokuWiki.
But I'm facing a problem: the content pulled into the wiki cannont be found in search.
To reproduce, copy the
NOW example so:
<?php
/**
* Plugin Now: Inserts a timestamp.
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Christopher Smith <chris@jalakai.co.uk>
*/
// must be run within DokuWiki
if(!defined('DOKU_INC')) die();
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class syntax_plugin_now extends DokuWiki_Syntax_Plugin {
public function getType() { return 'substition'; }
public function getSort() { return 32; }
public function connectTo($mode) {
$this->Lexer->addSpecialPattern('\[lorem\]',$mode,'plugin_now');
}
public function handle($match, $state, $pos, Doku_Handler $handler) {
return array($match, $state, $pos);
}
public function render($mode, Doku_Renderer $renderer, $data) {
// $data is what the function handle return'ed.
if($mode == 'xhtml'){
/** @var Doku_Renderer_xhtml $renderer */
$renderer->doc .= "Aliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.";
return true;
}
return false;
}
}
...Then put "[lorem]" in a page, save it, then search for "nisl" or "massa" for example. Even days after, it won't be found... How to solve it? How to inject my data in the indexer?
Thanks a lot.