Questions tagged [mediawiki-templates]

In MediaWiki, templates provide a way to include one page into other pages. This tag is for questions about template code and functionality.

From Help:Templates:

If you have standard texts you want to include on several pages, the MediaWiki template feature comes into play.

Templates are standard wiki pages whose content is designed to be transcluded (embedded) inside other pages. Templates follow a convention that the name is prefixed with "Template:", assigning it to that namespace; besides this, you can create them like any other wiki page.

191 questions
0
votes
1 answer

Nesting templates as part of a table is mysteriously eating a word in MediaWiki

When I use templates as individual lines in a table, it mostly seems to work perfectly, except for one spot where it keeps eating the first word of the second column, and I don't know why. Background: I have a small MediaWiki, just large enough to…
Bibliotango
  • 193
  • 11
0
votes
1 answer

Binding Template to Skin

Hi I have a template a quote box template, I have set certain text colors for this template to match a certain skin. Is there a way to 'bind' templates to skins meaning one template will take effect using one skin a different version of the template…
zprgsqvg
  • 21
  • 1
0
votes
1 answer

MediaWiki how to watch other pages when a page is added to a watchlist

I have a couple of pages on my wiki. And I am able to put a few of them on my watch list. But I want it to also watch a few other pages if certain pages have been put on the watch list. I can't find anywhere on how to do this or if this is…
Shems Eddine
  • 141
  • 11
0
votes
1 answer

How to import templates with sub-templates in a wiki

When i try to copy a template from wikipedia to my own wiki, there is a lot of sub-templates associated with it. Do i have to copy paste each sub-templates associated with it to my own wiki which is using mediawiki?
jesho
  • 171
  • 1
  • 1
  • 6
0
votes
1 answer

MediaWiki invoke image not working

I'm trying to invoke an image with infobox and infoboxImage. Here is what I have.... |image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|upright= {{{image_upright|1}}}|alt={{{alt|}}}}} And I get the following…
0
votes
1 answer

New line inserted when passing a category link as a template parameter

I have a mediawiki template which contains the following code: (there is more, but this is the part relevant to the question) [[{{#if:{{{page|}}}|{{{page|}}}|{{{ns|}}}{{{1}}}}}]] I tried to use it where {{{ns}}} is :Category:, but the first colon…
john
  • 1,156
  • 9
  • 22
0
votes
1 answer

How to get the first page of a template using #switch?

I recently installed MediaWiki and I have created some templates. Now I want to create a template news that gives me only the first page, I tried with switch (in mysite.org/wiki/Template:Pagina_principale/Vetrina): {{#switch: {{#expr: 1 +…
Mustapha Aoussar
  • 5,833
  • 15
  • 62
  • 107
0
votes
1 answer

Mediawiki Images no resize

How can I force mediawiki to disable resizing and use the original size of my image? My main problem is that I'm uploading small parts of screenshots. If I don't use the original size then they look awful. (Imagine a 237px wide image resized to…
nagylzs
  • 3,954
  • 6
  • 39
  • 70
0
votes
1 answer

Parse MediaWiki Template-Block

I have a little problem with parsing a MediaWiki Template-Block: http://regex101.com/r/dD1hC9/1 The RegEx I use to get the template from the text is: \{\{Template1 (.+?)\}\}. The template: {{Template1 |Parameter1=Text |Parameter2=Text…
0
votes
1 answer

Mediawiki category infobox parameter

I am making a infobox template for a wiki I am working on. I want to add a publisher parameter to the infobox but I want it to also automatically categorize it. So for example if I put in publisher = Ocean Software it will automatically link to…
0
votes
1 answer

Selectively hiding redlinks in MediaWiki

I've got a template designed to transclude content into the mainspace from a page in another namespace; it's used to aggregate a large number of pages into a single table. Its basic structure is this: Template:Paget
0
votes
1 answer

If condition in mediawiki not working so that please help me

i want to display image when hideDiploma field is not 1. i will try for that but not working the code as follow: {{ #if:{{{hideDiploma|}}}|
0
votes
1 answer

MediaWiki edit history in composite files

I have several MediaWiki files, which include a list of templates inside them. If I edit one of these files I can see the edit history. But if I edit a Template file, it's is not shown in the composite file. I know logically, the history belongs to…
ssm
  • 620
  • 6
  • 24
0
votes
1 answer

Get query string from Mediawiki page

Is there any way (like an undocumented magic word perhaps) to get the current query string (or full URL including query string) from within a Mediawiki template or Scribunto (Lua) module?
Brett Zamir
  • 14,034
  • 6
  • 54
  • 77
0
votes
3 answers

How to include the result of an api request in a template?

I'm creating a wiki using Mediawiki for the first time. I would like to include automatically all backlinks of the current page in a template (like the "See also" section). I tried to play with the API, successfully, but I still haven't succeed in…
hazelnut
  • 15
  • 1
  • 8
1 2 3
12
13