Nodyn:File other/doc
Dyma'r meta-nodyn {{file other}}.
Mae'r nodyn hwn yn cynorthwyo nodiadau eraill darganfod os eu bod nhw ar dudalen "Ffeil:" neu ryw dudalen "arall."
Defnydd
[golygu cod]Mae'r nodyn yma fel arfer yn cymryd dau baramedr, fel hyn:
{{file other | File page text | Other pages text }}
Os yw'r nodyn ar dudalen ffeil (delwedd), bydd yn dod yn ôl gyda:
- File page text
Os yw'r nodyn ar unrhyw dudalen arall, bydd yn dod yn ôl gyda:
- Other pages text
Gallwch ddefnyddio'r nodyn fel ei fod yn ychwanegu categori wrth iddo fod ar dudalennau ffeiliau'n unig. Felly nid yw'n ychwanegu tudalennau sy'n dangos y nodyn yn unig. Fel hwn:
{{file other | [[Categori:Rhyw gategori cynnal a chadw]] }}
Neu i rybuddio y ni ddylech ddefnyddio'r nodyn ar dudalennau eraill:
{{file other | | Dylech ddefnyddio'r nodyn hwn ar dudalennau ffeiliau (delweddi) yn unig.}}
Note that in the first case above the "other" parameter was not used, and in the second example the "file" parameter was left empty.
Demospace
[golygu cod]For testing and demonstration purposes this template can take a parameter named demospace.
- If it has the value file it returns the file page text.
- It if has the value other or any other value such as the name of some other namespace it returns the other pages text.
- If the parameter is empty or undefined, the actual page type determines the result.
Like this:
{{file other | File page text | Other pages text | demospace = file }}
No matter on what kind of page the code above is used it will return this:
- File page text
You can make it so your template also understands the demospace parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:
{{file other | File page text | Other pages text | demospace = {{{demospace|}}} }}
Technical details
[golygu cod]This template detects "File talk:" pages as type other.
Namespace "Image" was renamed to "File" on 11 December 2008. This template was updated to understand both names well before that, thus it still works fine.
This template works like {{main talk other}}, for more examples and technical details see full documentation there.
See also
[golygu cod]Nodyn:Namespace detect see also