Difference between revisions of "Extension talk:TreeNav.php"
From Organic Design wiki
m |
(Obtaining the tree content) |
||
| Line 2: | Line 2: | ||
[[Image:TreeNavConcept.png|640px]] | [[Image:TreeNavConcept.png|640px]] | ||
| − | == | + | == Obtaining the tree content == |
| − | The first issue that comes to mind is, how do we know if the current page is within the sidebar tree and where in the tree? I | + | The first issue that comes to mind is, how do we know if the current page is within the sidebar tree and where in the tree? The content of all the rendered trees is available in the ''$wgTreeAndMenu->args'' array, but the problem is that the sidebar tree is rendered after the page has been generated because it's built directly from within the skin itself. So this can be fixed either by pre-rendering the tree, or by rendering it a second time internally within the TreeNav extension. I'll use the latter method for now even though it's less efficient. It only needs to perform a pre-parse on the sidebar article not a full render so it's not too bad. And in fact only the content inside the ''#tree'' parser-function need to be pre-parsed. |
Revision as of 01:30, 14 February 2009
Obtaining the tree content
The first issue that comes to mind is, how do we know if the current page is within the sidebar tree and where in the tree? The content of all the rendered trees is available in the $wgTreeAndMenu->args array, but the problem is that the sidebar tree is rendered after the page has been generated because it's built directly from within the skin itself. So this can be fixed either by pre-rendering the tree, or by rendering it a second time internally within the TreeNav extension. I'll use the latter method for now even though it's less efficient. It only needs to perform a pre-parse on the sidebar article not a full render so it's not too bad. And in fact only the content inside the #tree parser-function need to be pre-parsed.



