Page 1 of 1

content rerendering

Posted: Wed Nov 02, 2005 6:03 am
by trick
I want to make a module that will take the content of a web page (the stuff that is in {content}) and do a buch of stuff to it. Is there a function for this, I couldn't find anything in the skeleton module.

Re: content rerendering

Posted: Fri Nov 04, 2005 7:18 pm
by sjg
Well, the Skeleton module is only a starting point.

The Authoritative Guide is the module base class CMS_ROOT/lib/classes/class.module.inc.php

Some likely starting points for you seem like they might be:

Code: Select all

	/**
	 * Called with the content of the template before it's sent to smarty
	 * for processing.
	 *
	 * @param string The template text
	 */
	function ContentTemplate(&$template)
	{
	}

	/**
	 * Called with the content of the stylesheet before it is pasted into the
	 * template.
	 *
	 * @param string The stylesheet text
	 */
	function ContentStylesheet(&$stylesheet)
	{
	}

	/**
	 * Called with the title before it is pasted into the template.
	 *
	 * @param string The title text
	 */
	function ContentTitle(&$title)
	{
	}

	/**
	 * Called with the content data before it is pasted into the template.
	 *
	 * @param string The content text
	 */
	function ContentData(&$content)
	{
	}
There's a lot of great stuff in there. When I was writing Skeleton, I was amazed at all the stuff I'd overlooked while writing other modules :)

Re: content rerendering

Posted: Tue Nov 08, 2005 3:56 am
by trick
Thanks, but as I said to wishy on irc, it doesn't seem like the ContentData function is working?

Re: content rerendering

Posted: Tue Nov 08, 2005 4:20 am
by calguy1000
check out ContentPreRender and ContentPostRender, that's what CustomContent users.