Here's a basic Content plugin that does not a lot of anything. Just for learning...
I'd like to add additional functions within the class, but get errors every time. How do I add my own functions??? For example, a function that reads a file and returns the content of that file and sets $content to it instead of the root path as I have in this example.Code:<?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); class plgContentTest extends JPlugin { function onPrepareContent(&$row, &$params, $page) { $pattern = "{test}"; $content = JURI::root(); $row->text = preg_replace($pattern, $content, $row->text); } }



Reply With Quote
Bookmarks