Qv1et
Joined 4 April 2025
Info on creating licenses |
Add section on re-using templates |
||
(One intermediate revision by the same user not shown) | |||
Line 25: | Line 25: | ||
Licenses are relevant in the context of images. When you [[Special:Upload|upload a file]], you can select a license for it from a drop-down menu. To add licenses that will appear in this menu, you have to add them to the list on the [[MediaWiki:Licenses]] page. There can be multiple levels of nesting in the list to group together licenses. As an example, see the [[w: MediaWiki:Licenses|licenses on Wikipedia]]. | Licenses are relevant in the context of images. When you [[Special:Upload|upload a file]], you can select a license for it from a drop-down menu. To add licenses that will appear in this menu, you have to add them to the list on the [[MediaWiki:Licenses]] page. There can be multiple levels of nesting in the list to group together licenses. As an example, see the [[w: MediaWiki:Licenses|licenses on Wikipedia]]. | ||
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 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. |