Topic on Skin talk:Cavendish

Cavendish Logo Style

1
Michele.Fella (talkcontribs)

MW 1.37 - Cavendish MediaWiki skin version 2.6.0

I had to reinstall a customized version of Cavendish skin which of course was no more compatible with the new MW.

I found not woorking to use styling options in Localsettings.

For those who might find this usefull (and for mantainer to consider this as a change):


I defined $wgLogos in LocalSettings.php containing all my style properties, eg:

$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/<mylogo>.png" ];
$wgLogos['1x-options'] = [
        'background-color' => 'transparent',
        'background-repeat' => 'no-repeat',
        'background-size' => '100% auto',
        'z-index' => '3',
        'position' => 'absolute',
        'height' => '200px',
        'width' => '60px',
        'overflow' => 'visible'
];

Amended CavendishTemplate.php as following in order to properly parse and use style in logos for mw-wiki-logo class

 $logoAttributes = [];
 if($logos['1x']){
  $logoAttributes['class'] = 'mw-wiki-logo';
  $logoAttributes['id'] = 'logomik';
  $logoAttributes['style'] = '';
  foreach ($logo as $key => $value) {
   if($key){
    if($value){
     $logoAttributes['style'] = $logoAttributes['style'].$key.':'.$value.'; ';
    }else{
     $logoAttributes[$value];
    }
   }
  }
 }
 /*
 $logoAttributes = $logos['1x'] ?
 [
  'class' => 'mw-wiki-logo',
   'id' => 'logomik',
   'style' => 'width: ' . $logo['width'] .  'px; height: ' . $logo['height'] .  'px; margin-top: ' . $logo['margin'],
 ] : [];
 */
Reply to "Cavendish Logo Style"