Hi,
I am currently under a quandary. I have placed templates in categories, however I wish for the pages to be displayed without the "Template:" prefix.
Any help would be appreciated.
Regards
Paul
Paul Simmons wrote:
Hi,
I am currently under a quandary. I have placed templates in categories, however I wish for the pages to be displayed without the "Template:" prefix.
Any help would be appreciated.
How badly do you want to mess with the MW code?
Basically, it's easy if you change how categories are displayed. (Although I would still have someway to show that they are templates.)
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.
Quoting Jamie Bliss astronouth7303@gmail.com:
Paul Simmons wrote:
Hi,
I am currently under a quandary. I have placed templates in categories,
however
I wish for the pages to be displayed without the "Template:" prefix.
Any help would be appreciated.
How badly do you want to mess with the MW code?
Basically, it's easy if you change how categories are displayed. (Although I would still have someway to show that they are templates.)
Messing with code. Hmm. That depends if it is to be in a skin or the base functionality. I only want the category page when desplaying a template to strip the "Template:"
I am using templates for text reusability and simpler editing of small components in a larger page, and organisational flexability.
or am I going about this wrong and should just have a single page for each item instead of a template?
Regards
Paul
Paul Simmons wrote:
Messing with code. Hmm. That depends if it is to be in a skin or the base functionality. I only want the category page when desplaying a template to strip the "Template:"
Most likely CategoryPage.php.
I am using templates for text reusability and simpler editing of small components in a larger page, and organisational flexability.
or am I going about this wrong and should just have a single page for each item instead of a template?
Nope, sounds right. I encourage use of templates for this. (Disclaimer: I am not linked to WikiMedia in any manner. I just their mailing lists and software.)
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.
Quoting Jamie Bliss astronouth7303@gmail.com:
Paul Simmons wrote:
Messing with code. Hmm. That depends if it is to be in a skin or the base functionality. I only want the category page when desplaying a template
to
strip the "Template:"
Most likely CategoryPage.php.
I am using templates for text reusability and simpler editing of small components in a larger page, and organisational flexability.
or am I going about this wrong and should just have a single page for each
item
instead of a template?
Nope, sounds right. I encourage use of templates for this. (Disclaimer: I am not linked to WikiMedia in any manner. I just their mailing lists and software.)
-- Jamie
Thanks Jamie.
Quoting Jamie Bliss astronouth7303@gmail.com:
Paul Simmons wrote:
Messing with code. Hmm. That depends if it is to be in a skin or the base functionality. I only want the category page when desplaying a template
to
strip the "Template:"
Most likely CategoryPage.php.
Thanks...
I expect a regular expression substitution is required on the page title when it is displayed ... but I have no idea where to edit this.
Regards
Paul
Quoting Paul Simmons psimmons@iinet.net.au:
strip the "Template:"
Most likely CategoryPage.php.
Thanks...
I expect a regular expression substitution is required on the page title when it is displayed ... but I have no idea where to edit this.
my best guess is this line (well there is two of them)
$r .= "<li>{$articles[$index]}</li>";
Quoting Paul Simmons psimmons@iinet.net.au:
Quoting Paul Simmons psimmons@iinet.net.au:
strip the "Template:"
Most likely CategoryPage.php.
Thanks...
I expect a regular expression substitution is required on the page title
when
it is displayed ... but I have no idea where to edit this.
my best guess is this line (well there is two of them)
$r .= "<li>{$articles[$index]}</li>";
to save grief, this is the wrong location. Altering this code will not change the equivalent syntax of [[:Template: xxx|xxx] from displaying
I think the code will be imbedded in the toHTML method if ImageGallery
Solution ... Well it works for me
in CategoryPage.php
At the end of the Function doCategoryMagic replace
wfProfileOut( $fname ); return $r;
With
wfProfileOut( $fname ); /* Added to try and format 'Template: xxx' to 'xxx' */ $r = preg_replace ("/>Template:([\w\d -]+)</i",">$1<", $r); return $r;
This will replace all displayed text "Template:XXXX" to "XXXX" and still leave the link to the template intact.
Thankyou Jamie for setting me on the right track
Regards
Paul
On 25/11/05, Paul Simmons psimmons@iinet.net.au wrote:
I am using templates for text reusability and simpler editing of small components in a larger page, and organisational flexability.
or am I going about this wrong and should just have a single page for each item instead of a template?
I'm not suggesting what you're doing is "wrong", but did you realise that something doesn't need to be in the Template: namespace to be included as a template onto another page? You can actually include *any* page with the same syntax, by giving the full name, with the one exception of pages in the "main" namespace, which have no prefix - because {{Foo}} defaults to {{Template:Foo}}, you have to use {{:Foo}} with a leading colon.
It seems to me that this might remove the need for your hack, since you can just not have the pages called Template: anything in the first place!
-- Rowan Collins BSc [IMSoP]
Quoting Rowan Collins rowan.collins@gmail.com:
On 25/11/05, Paul Simmons psimmons@iinet.net.au wrote:
I am using templates for text reusability and simpler editing of small components in a larger page, and organisational flexability.
or am I going about this wrong and should just have a single page for each
item
instead of a template?
I'm not suggesting what you're doing is "wrong", but did you realise that something doesn't need to be in the Template: namespace to be included as a template onto another page? You can actually include *any* page with the same syntax, by giving the full name, with the one exception of pages in the "main" namespace, which have no prefix - because {{Foo}} defaults to {{Template:Foo}}, you have to use {{:Foo}} with a leading colon.
It seems to me that this might remove the need for your hack, since you can just not have the pages called Template: anything in the first place!
Thanks Rowan I did not, I will give it a go and it will save me much future upgrade grief.
mediawiki-l@lists.wikimedia.org