Cose di MediaWiki: differenze tra le versioni
Nessun oggetto della modifica |
|||
| Riga 11: | Riga 11: | ||
* [[MediaWiki:Common.css]] - Stili generali (<code>/* Gli stili CSS inseriti qui si applicano a tutti i temi */</code>) | * [[MediaWiki:Common.css]] - Stili generali (<code>/* Gli stili CSS inseriti qui si applicano a tutti i temi */</code>) | ||
* [[MediaWiki:Print.css]] - Stili specifici alla stampa (<code>/* Gli stili CSS inseriti qui si applicano all'output in stampa */</code>) | * [[MediaWiki:Print.css]] - Stili specifici alla stampa (<code>/* Gli stili CSS inseriti qui si applicano all'output in stampa */</code>) | ||
== Modificare la configurazione delle skin == | |||
In MediaWiki, le diverse skin possono fornire alcune opzioni di configurazione, definite nella sezione <code>config</code> del file <code>skin.json</code>, che possono essere sovrascritte esternamente dagli amministratori, senza modificare i file della skin. | |||
Basta aggiungere una variabile del tipo <code>$wg<NomeOpzione></code> al file <code>LocalSettings.php</code>. Per esempio, se l'opzione si chiama <code>CosoText</code>, basta aggiungere una riga <code>$wgCosoText = "...";</code>. | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
|+ | |||
|In MediaWiki, how do I change a config value for a them? Must I change it in the skin.json or is there a proper way? | |||
|- | |||
|<mark>You should '''not''' change configuration values directly in</mark> <code>skin.json</code>. Doing so makes it difficult to update the skin later, as your changes will be overwritten when you download a new version. [1, 2] | |||
The proper way to change a config value for a theme (skin) is to override it in your '''<code>LocalSettings.php</code>''' file. [3, 4, 5] | |||
=== How to Override Skin Settings === | |||
Most modern MediaWiki skins define their configurable options in their <code>skin.json</code> file under a "config" section. To override these: [6] | |||
# '''Identify the Variable Name:''' Look in the skin's <code>skin.json</code> file for the configuration keys. They usually look like <code>SkinNameVariable</code>. | |||
# '''Add to LocalSettings.php:''' Open your <code>LocalSettings.php</code> file and add the variable with your desired value '''after''' the line where you load the skin (e.g., after <code>wfLoadSkin( 'SkinName' );</code>). [7, 8] | |||
'''Example:''' | |||
If you are using the '''Citizen''' skin and want to change its default theme, you would add this to <code>LocalSettings.php</code>: | |||
<code>wfLoadSkin( 'Citizen' ); | |||
$wgCitizenTheme = 'dark'; ''// Example override''</code> | |||
=== Other Proper Customization Methods === | |||
If you want to change the ''look'' rather than just a functional setting: | |||
* '''Site-wide CSS:''' Use the page <code>MediaWiki:Common.css</code> on your wiki for changes that apply to all skins. | |||
* '''Skin-specific CSS:''' Use <code>MediaWiki:SkinName.css</code> (e.g., <code>MediaWiki:Vector.css</code>) to target only a specific theme. | |||
* '''User Preferences:''' Some settings (like the default skin itself via <code>$wgDefaultSkin</code>) can be set in <code>LocalSettings.php</code> but may still be overridden by individual users in their '''Special:Preferences'''. [1, 2, 9, 10] | |||
Are you trying to change a specific setting for a particular skin, like '''Vector''' or '''Citizen'''? | |||
[1] <nowiki>https://stackoverflow.com</nowiki> | |||
[2] <nowiki>https://stackoverflow.com</nowiki> | |||
[3] <nowiki>https://www.mediawiki.org</nowiki> | |||
[4] <nowiki>https://www.mediawiki.org</nowiki> | |||
[5] <nowiki>https://www.digitalocean.com</nowiki> | |||
[6] <nowiki>https://www.mediawiki.org</nowiki> | |||
[7] <nowiki>https://www.awardspace.com</nowiki> | |||
[8] <nowiki>https://doc.wikimedia.org</nowiki> | |||
[9] <nowiki>https://www.mediawiki.org</nowiki> | |||
[10] <nowiki>https://workingwithmediawiki.com</nowiki> | |||
|- | |||
|So how do I change MedikColor for medik theme? | |||
|- | |||
|To change the <code>MedikColor</code> for the '''Medik''' theme, you must add the configuration variable to your '''<code>LocalSettings.php</code>''' file. | |||
The variable you need is <code>$wgMedikColor</code>. | |||
=== How to Apply the Change === | |||
# Open your <code>LocalSettings.php</code> file (typically found in the root directory of your MediaWiki installation). | |||
# Locate the line where the Medik skin is loaded: <code>wfLoadSkin( 'Medik' );</code>. | |||
# Add the following line '''below''' the loading line: | |||
$wgMedikColor = '#YOUR_HEX_CODE'; | |||
* ''Replace <code>#YOUR_HEX_CODE</code> with your preferred color (e.g., <code>#00ff00</code> for green or <code>#ff0000</code> for red).'' | |||
=== Why this works === | |||
This setting controls the color of the '''navbar''' and '''underlines''' throughout the skin. By defining it in <code>LocalSettings.php</code> instead of <code>skin.json</code>, you ensure your customization is "update-proof" and won't be deleted if you upgrade the Medik skin later. | |||
=== Advanced: Changing other Medik settings === | |||
If you want to customize further, Medik also supports changing the logo placement via <code>$wgWriteShowLogo</code> (options: <code>'main'</code>, <code>'sidebar'</code>, or <code>'none'</code>). | |||
Are you looking to change any other specific parts of the layout, like the '''sidebar''' or '''logo''' position? | |||
|} | |||
== Note == | == Note == | ||
<references /> | <references /> | ||
Versione delle 15:04, 22 apr 2026
Appunti relativi all'uso e all'amministrazione di MediaWiki, e come fare alcune cose specifiche.
Strumento di citazioni nel VisualEditor
Di default, il VisualEditor non sembra avere un metodo per aggiungere citazioni e riferimenti nella pagina...
Se questo è il caso, è perché va attivata l'estensione (inclusa) Cite; questo aggiungerà un relativo tasto nel VisualEditor che comodamente permette di aggiungere le citazioni belline col classico numeretto cliccabile inline.[1]
Aggiungere CSS custom
MediaWiki include una funzionalità per permettere agli amministratori di aggiungere comodamente CSS custom al sito.[2][3] Basta modificare le pagine di sistema relative al tipo fogli di stile che si vogliono arricchire, vuote di default, aggiungendo il proprio codice:
- MediaWiki:Common.css - Stili generali (
/* Gli stili CSS inseriti qui si applicano a tutti i temi */) - MediaWiki:Print.css - Stili specifici alla stampa (
/* Gli stili CSS inseriti qui si applicano all'output in stampa */)
Modificare la configurazione delle skin
In MediaWiki, le diverse skin possono fornire alcune opzioni di configurazione, definite nella sezione config del file skin.json, che possono essere sovrascritte esternamente dagli amministratori, senza modificare i file della skin.
Basta aggiungere una variabile del tipo $wg<NomeOpzione> al file LocalSettings.php. Per esempio, se l'opzione si chiama CosoText, basta aggiungere una riga $wgCosoText = "...";.
| In MediaWiki, how do I change a config value for a them? Must I change it in the skin.json or is there a proper way? |
You should not change configuration values directly in skin.json. Doing so makes it difficult to update the skin later, as your changes will be overwritten when you download a new version. [1, 2]
The proper way to change a config value for a theme (skin) is to override it in your How to Override Skin SettingsMost modern MediaWiki skins define their configurable options in their
Example: If you are using the Citizen skin and want to change its default theme, you would add this to
Other Proper Customization MethodsIf you want to change the look rather than just a functional setting:
Are you trying to change a specific setting for a particular skin, like Vector or Citizen? [1] https://stackoverflow.com [2] https://stackoverflow.com [3] https://www.mediawiki.org [4] https://www.mediawiki.org [5] https://www.digitalocean.com [6] https://www.mediawiki.org [7] https://www.awardspace.com [8] https://doc.wikimedia.org [9] https://www.mediawiki.org [10] https://workingwithmediawiki.com |
| So how do I change MedikColor for medik theme? |
To change the MedikColor for the Medik theme, you must add the configuration variable to your LocalSettings.php file.
The variable you need is How to Apply the Change
$wgMedikColor = '#YOUR_HEX_CODE';
Why this worksThis setting controls the color of the navbar and underlines throughout the skin. By defining it in Advanced: Changing other Medik settingsIf you want to customize further, Medik also supports changing the logo placement via Are you looking to change any other specific parts of the layout, like the sidebar or logo position? |
Note
- ↑ https://www.mediawiki.org/wiki/Help:VisualEditor/User_guide/Citations-Full
- ↑ Manual:CSS - MediaWiki: https://www.mediawiki.org/wiki/Manual:CSS
- ↑ Changing the CSS in MediaWiki: https://www.inmotionhosting.com/support/edu/mediawiki/changing-css-media-wiki/