| 168 | == The really advanced stuff... |
| 169 | |
| 170 | (Most likely post-0.13) |
| 171 | |
| 172 | === Transclusion |
| 173 | |
| 174 | The basic idea is that the content of a Wiki page can be reused and displayed in some other places, typically another wiki page which aggregates the content of several other pages. |
| 175 | |
| 176 | One typical use case is to transclude a parametric page used as a template (`Template:` namespace - #3021). In order to be really useful, this implies having wiki variables, and some control structures (at the very least simple conditionals). |
| 177 | |
| 178 | Also, we could have ways to include only //parts// of a page, by using some kind of selector mechanism (XPath or CSS inspired?) on the WikiDom tree. |
| 179 | |
| 180 | Some existing implementations can serve as good starting points [http://twiki.org/cgi-bin/view/Codev/ParameterizedIncludes ParameterizedIncludes] in TWiki, [MediaWiki:Help:Template Template] in MediaWiki, [MoinMoin:HelpOnLinking#Embedding Embedding] and [MoinMoin:HelpOnMacros/Include Include] in MoinMoin and the [http://www.dokuwiki.org/plugin:include plugin:include] of DokuWiki. |
| 181 | |
| 182 | Trac could use both the `{{<resource>}}` syntax and a more explicit Include macro/WikiProcessor. The latter form would allow to pass "complex" parameters for template, e.g. |
| 183 | {{{ |
| 184 | {{{#!include page="Template:ReleaseInfo" version="1.0" |
| 185 | {{{#!param name="description" |
| 186 | This version is feature complete, mind you. |
| 187 | - all existing tickets are implemented |
| 188 | - there are no known (or unknown) bugs |
| 189 | - there's even no feature left to be implemented, all is there |
| 190 | }}} |
| 191 | }}} |
| 192 | }}} |
| 193 | Alternatively, the default content of the include processor could be made available to the wiki variables present in the template in a special variable, e.g. "INCLUDE_CONTENT". |
| 194 | |
| 195 | Variables expansion could also be done using a dedicated syntax (e.g. `@INCLUDE_CONTENT@`, like [MoinMoin:HelpOnVariables MoinMoin] or [http://www.dokuwiki.org/plugin:templater plugin:templater] in dokuwiki), (to be continued...) |
| 196 | |
| 197 | See also #4468. |