<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fdeveloper%2FHooking_Pages</id>
	<title>Cchost/developer/Hooking Pages - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fdeveloper%2FHooking_Pages"/>
	<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Hooking_Pages&amp;action=history"/>
	<updated>2026-10-01T09:33:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Hooking_Pages&amp;diff=19567&amp;oldid=prev</id>
		<title>Fourstones: New page: Category:ccHost Category:ccMixter Category:Developer Category:Software Category:Technology  {{lowercase}} Page rendering happens in 2 main phases in the CCPage class. I...</title>
		<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Hooking_Pages&amp;diff=19567&amp;oldid=prev"/>
		<updated>2008-11-03T16:37:48Z</updated>

		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/wiki/Category:CcHost&quot; title=&quot;Category:CcHost&quot;&gt;Category:ccHost&lt;/a&gt; &lt;a href=&quot;/wiki/Category:CcMixter&quot; title=&quot;Category:CcMixter&quot;&gt;Category:ccMixter&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Developer&quot; title=&quot;Category:Developer&quot;&gt;Category:Developer&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Software&quot; title=&quot;Category:Software&quot;&gt;Category:Software&lt;/a&gt; &lt;a href=&quot;/wiki/Category:Technology&quot; title=&quot;Category:Technology&quot;&gt;Category:Technology&lt;/a&gt;  {{lowercase}} Page rendering happens in 2 main phases in the CCPage class. I...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:ccHost]]&lt;br /&gt;
[[Category:ccMixter]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Technology]]&lt;br /&gt;
&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
Page rendering happens in 2 main phases in the CCPage class. In Phase 1 all the variables are gathered into a huge variable array. In Phase 2 CCPage calls down to it&amp;#039;s base class, CCSkin, to merge the variables with the config-selected page template.&lt;br /&gt;
&lt;br /&gt;
Right before Phase 2 happens, CCPage triggers an event to let any custom code prepare any last minute hacks before handing off to the template engine (CCSkin).&lt;br /&gt;
&lt;br /&gt;
If you create a module that hooks that event you can manipulate the variables (er, hack at the array) to change the appearance of any/all pages.&lt;br /&gt;
&lt;br /&gt;
An example: (put the following code with a PHP extension into your &amp;#039;&amp;#039;&amp;#039;&amp;lt;local_files&amp;gt;/lib&amp;#039;&amp;#039;&amp;#039; directory):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  CCEvents::AddHandler(CC_EVENT_RENDER_PAGE,  &amp;#039;page_trapper&amp;#039; );&lt;br /&gt;
 &lt;br /&gt;
  function page_trapper( &amp;amp;$page )&lt;br /&gt;
  {&lt;br /&gt;
     // This might be an array (I think)&lt;br /&gt;
     $caption =&amp;amp; $page-&amp;gt;vars[&amp;#039;page-caption&amp;#039;];&lt;br /&gt;
 &lt;br /&gt;
     // same with this&lt;br /&gt;
     $title =&amp;amp; $page-&amp;gt;vars[&amp;#039;page-title&amp;#039;];&lt;br /&gt;
 &lt;br /&gt;
     $caption = &amp;#039;CAP: &amp;#039; . $caption;&lt;br /&gt;
     $title = &amp;#039;TITLE: &amp;#039; . $title;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The code above will simply append strings to the caption and title to every page in the system. If you are looking for a specific page you can for that page&amp;#039;s title (e.g. &amp;#039;str_file_deleting&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
Of course your hacks are not limited to these variables. You can also, say, remove the bread crumbs from specific page by simply null-ing out the &amp;#039;bread_crumbs&amp;#039; var:&lt;br /&gt;
&lt;br /&gt;
  CCEvents::AddHandler(CC_EVENT_RENDER_PAGE,  &amp;#039;page_trapper&amp;#039; );&lt;br /&gt;
 &lt;br /&gt;
  function page_trapper( &amp;amp;$page )&lt;br /&gt;
  {&lt;br /&gt;
     $title =&amp;amp; $page-&amp;gt;vars[&amp;#039;page-title&amp;#039;];&lt;br /&gt;
 &lt;br /&gt;
     if( $title == &amp;#039;str_file_deleting&amp;#039; )&lt;br /&gt;
     {&lt;br /&gt;
        unset( $page-&amp;gt;vars[&amp;#039;bread_crumbs&amp;#039;] );&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
In order to get a full idea of what variables are available you can inspect the page object:&lt;br /&gt;
&lt;br /&gt;
   CCDebug::Enable(true);&lt;br /&gt;
   CCDebug::PrintVar($page);&lt;/div&gt;</summary>
		<author><name>Fourstones</name></author>
	</entry>
</feed>