I am not sure how I would implement a text parser. Is there any examples?
I have been looking at the blog module, looking at the code could I use something from here to pull a limited text.
How about the following? could it be adapted?
/**
* Get a bbcode parsed summary of the blog entry
*/
function ParagraphSummary(){
if(self::$allow_wysiwyg_editing) {
return $this->obj('Content')->FirstParagraph('html');
} else {
$parser = new BBCodeParser($this->Content);
$html = new HTMLText('Content');
$html->setValue($parser->parse());
return $html->FirstParagraph('html');
}
}
unfortunately this is just returning the whole text with code.
Is there a simple answer to this, I need to use this a lot in the site I am building.