Qv1et (talk | contribs)
m Add MediaWiki wiki link
Qv1et (talk | contribs)
Add section on re-using templates
 
Line 26: Line 26:


When you open the [[Special:Upload]] page and select a license you will see a link to the template for this license below the drop-down menu. When there is no license yet, the link will be red. You can click on the link to create the template. You can use the license templates on Wikipedia, the [[mediawikiwiki:Category:License_templates|MediaWiki wiki]] or other MediaWiki sites as a reference.
When you open the [[Special:Upload]] page and select a license you will see a link to the template for this license below the drop-down menu. When there is no license yet, the link will be red. You can click on the link to create the template. You can use the license templates on Wikipedia, the [[mediawikiwiki:Category:License_templates|MediaWiki wiki]] or other MediaWiki sites as a reference.
=== Re-using Templates and Page Code from Wikipedia ===
You can go to any Wikipedia page click on "Edit source" and copy the code your wiki page. However, the result will probably not end up looking identical to the Wikipedia page. The reason is that the code depends on templates and modules that might not be available on your wiki. It can be helpful to edit the Wikipedia page down to a minimum working example, removing all the code you don't need (your changes will not be published as long as you don't click on "Publish changes"). Then go through all of the templates that are used in the code (which can be identified by the double curly brackets) and create the ones that don't exist on your wiki yet.
Example: If the page code contains the string <code><nowiki>{{Round corners}}</nowiki></code> you need to create the page <your wiki URL>/wiki/Template:Round_corners. Just visit this URL and if the template does not exist yet, click on "Create source". Then use the code of the corresponding template from Wikipedia. This template might in turn also use other templates so you might need to repeat this process a couple of times.
If you are having trouble parsing and making sense of the Wikipedia source code, you can also use a language model to assist you, break the source code down and help with identifying sources of errors.