Hi Rowan, Thanks again for your detailed explaination.
I do have a better understanding of Namespace and subpage now.
But I still have one problem.
As I explained earlier that I am running mediawiki 1.5.2 on a Fedora Core 4 box.
I have PHP-5.0.4-10.5 with Zend PHP optimizer installed.
Currently the my mediawiki system does not seem to interpret {{/box-header|{{{topic}}} portal|Portal:{{{topic}}}/Intro|}} It interpret the above as Template:/box-header}portal|Portal:{{{topic}}}/Intro|}}
My system seems does not understand {{{topic}}} when {{{topic}}} is inside {{Portal|}}}
Is this a bug or I am missing something
Thanks jc
--- Rowan Collins rowan.collins@gmail.com wrote:
On 11/11/05, judi chen judi_chen@yahoo.com wrote:
My problem is that I copied the same code from wikipedia to my wiki site. But the display is different. The page I copied from wikipedia is
http://en.wikipedia.org/w/index.php/Template:Box_portal_skeleton
Aha, now I can hopefully be a bit less vague about what's going on (at the price of being more long-winded, to make sure I'm not assuming knowledge you don't have).
it seems that on the wikipedia site, some
variables
get automatically plug into the {{ }} function.
Yes, that is how templates work; see http://meta.wikimedia.org/wiki/Help:Template Although in some ways very simple, the template inclusion system is extremely powerful - almost, some would argue, *too* powerful - and can be combined with other features in very intricate ways, as seems to be the case here.
The code associated with it is
{{/box-header|{{{topic}}} portal|Portal:{{{topic}}}/Intro|}} {{Portal:{{{topic}}}/Intro}}
Actually, no it's not; this may seem picky, but the code is {{/box-header|{{{topic}}} portal|Portal:{{{topic}}}/Intro|}} Note that it is all on one line - I'd been assuming that the linebreaks were just from copying it into the e-mail, but the output below looks almost as though the first line is being interpretted as a template with one parameter, "{{{topic", hence the stray "}" at the end. So perhaps make sure the code is *exactly* as on Wikipedia.
Template:/box-header} portal|Portal:{{{topic}}}/Intro|}} {{Portal:{{{topic}}}/Intro}}
The next thing to remember is that templates will not necessarily look tidy when viewed on their own, since all the variables (numbers or labels in {{{triple braces}}}) will not be filled in, so the code may not even be valid (and will probably look different on different versions of MediaWiki). Only once they have been included on another page, with the appropriate parameters to fill those variables (as in "{{box portal skeleton| topic=Chess}}"), will they make any sense. This is what the "{{Portal:{{{topic}}}/Intro}}" bit is for - once in use, the "{{{topic}}}" will become, say, "Chess", and this line will include as a template the page "Portal:Chess/Intro".
In this particular case, the template's authors have also made heavy use of sub-page features (see
http://meta.wikimedia.org/wiki/Help:Link#Subpage_feature
). The "Portal:Chess/Intro" above is technically a sub-page, but since it's full name is given, that doesn't really matter. More importantly, we have things like "{{/box-header}}", which are also intended as sub-page links - i.e. they refer not to "Template:/box-header" but to "<current page>/box-header"; assuming the page we're pasting into is "Portal:Chess", {{/box-header}} should become equivalent to {{Portal:Chess/box-header}} .
And now we come to what may be the central issue of your problem: sub-pages can be turned on and off for each namespace in the wiki, and are off by default for the main namespace (the one with no specific prefix). *But*, the "Portal" namespace doesn't actually *exist* in a default install, so as far as the software is concerned, a page called "Portal:Chess" is one with that exact name in the main namespace, as opposed to one called "Chess" in the namespace called "Portal". [See http://meta.wikimedia.org/wiki/Help:Namespace ]
To emulate the setup of Wikipedia completely, therefore, you need to first create a namespace called "Portal" (see
http://meta.wikimedia.org/wiki/Help:Custom_namespaces
), and then enable sub-pages for that namespace, by editting your LocalSettings.php. You can use your template without doing any of that though, in an existing namespace which *does* have sub-pages, such as a Talk: or Project: page (or, indeed, another Template: page).
I hope this explains most of what's going on here, and apologies if it seems too long-winded; but I thought it better to try and explain the issues involved rather than just troubleshoot the problem, so that you can use the features effectively yourself, and overcome other problems as they arise.
-- Rowan Collins BSc [IMSoP]
mediawiki-l@Wikimedia.org
__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
mediawiki-l@lists.wikimedia.org