User

Domino/Project:Wiki Glossary

From Dogcraft Wiki

(Created page with "===Templates=== Templates are a consistent way to re-use text (or other content) across the wiki, regardless of what page your editing. Every template has a name, some content...")
 
No edit summary
Line 9: Line 9:


For example, lets look at the `Read more` template: Here, the name of the template is "Read more", it has 1 parameter called "name", and the content is "To read more about the topic, see the {{{name}}} page." If you wanted to use this template on a page, you could do {{Read more | name = Leon}} to generate `To read more about the topic, see the Leon page.`
For example, lets look at the `Read more` template: Here, the name of the template is "Read more", it has 1 parameter called "name", and the content is "To read more about the topic, see the {{{name}}} page." If you wanted to use this template on a page, you could do {{Read more | name = Leon}} to generate `To read more about the topic, see the Leon page.`
==Misc==
Special:WhatLinksHere/<pagename> lists every single page which has a link to <pagename>.  Template transclusions also count as a 'link', so you can get a list of all pages where a specific template is in use. Every page has a button in the bottom right red box pointing to its Special:WhatLinksHere page, so you can get here fast. (This can be useful for redirects too, which are also included as 'links'.)
When working with system messages, you can add `?uselang=qqx` to the end of the page URL (or `&uselang=qqx` if the URL already has a question mark), which will show all the messages in use on the page by their name instead of their content. This can be extremely useful to find what message to edit! [[Image]]

Revision as of 04:06, 12 February 2023

Templates

Templates are a consistent way to re-use text (or other content) across the wiki, regardless of what page your editing. Every template has a name, some content, and may have parameters, and a template's name is always the name of a wiki page in the Template: namespace. When you add a template to a page, you only need to add its name (and any parameters), and when viewing said page, the template name will be replaced with whatever is on the Template: page the name is pointing to. When editing the page, you will continue to see the template behave differently from the rest of the page. In the VisualEditor, you can add templates using their own popup, in the top-bar at `Insert > Templates` by searching for the template's name. In the Source Editor, you can add a template by surrounding the template's name with two brackets like this: {{template name}}.

For example, lets look at the "Egg" template. Here, the name of the template is (surprisingly :p) Egg, and it doesn't have any parameters. If you look at the Template:Egg page, you'll see the text "Eggs are great for breakfast.", that's the template's content. Adding the template on any page will show that sentence once you exit the editor. So, {{Egg}} generates: Eggs are great for breakfast.. And if you were to change the text on the Template:Egg page to "Omelettes are great for breakfast.", then everywhere the Egg template is used would update automatically!

The contents of a template (whatever is on the Template:Template name page) can have special sections of text called a parameter. Parameters are kind of like variables, they can be specified on the page that's using the template, kind of like an input. Parameters usually have their own names, and values. In the VisualEditor the template popup has a textbox for every parameter, while in the Source Editor, parameters can be added like this: {{template name|parameter_name = value|another_parameter_name = value}}. Inside a template's content, it can refer to a parameter by its name, which when its added to a page will be replaced by its specified value. A template's content is always edited using the Source Editor. In there, parameters are marked by their name being surrounded with 3 brackets. (Eg.: {{{parameter name}}})

For example, lets look at the `Read more` template: Here, the name of the template is "Read more", it has 1 parameter called "name", and the content is "To read more about the topic, see the {{{name}}} page." If you wanted to use this template on a page, you could do Template:Read more to generate `To read more about the topic, see the Leon page.`

Misc

Special:WhatLinksHere/<pagename> lists every single page which has a link to <pagename>. Template transclusions also count as a 'link', so you can get a list of all pages where a specific template is in use. Every page has a button in the bottom right red box pointing to its Special:WhatLinksHere page, so you can get here fast. (This can be useful for redirects too, which are also included as 'links'.)

When working with system messages, you can add `?uselang=qqx` to the end of the page URL (or `&uselang=qqx` if the URL already has a question mark), which will show all the messages in use on the page by their name instead of their content. This can be extremely useful to find what message to edit! Image

This page was last modified on 12 February 2023, at 04:06. (5 months ago)