Page MenuHomePhabricator

Understand how skins and templates work
Closed, ResolvedPublic

Description

Before refactoring the current front-end code, we should first understand how skins and templates work.

Event Timeline

From Customization:Explaining skins

A 'Skin' in MediaWiki is a PHP class containing functions (or methods) designed to gather the information needed to generate the HTML that your browser displays for each page in the Wiki.

This could be the way to rework our current fronted to make it maintainable, modular and less of an UI hack.

  1. Mediawiki uses the Vector skin as default. Code can be found on the Github mirror.
  2. The manual on Skinning is pretty long and made of 3 parts:
    1. Part 1
    2. Part 2
    3. Part 3
  3. Developing a skin from zero could be a huge work/overkill. I would suggest to simply fork Vector and extend it to achieve with php the same result we are achieving right now with JavaScript.

As a starting point we will need to split our "monolithic" JS into a "template part", to translate it to php, and into the actual "user interaction" part that will remain as JavaScript.

Templates seem more "plain text" oriented and could be leveraged to simplify the source file (already used / done in current frontend JS file)

  1. Mediawiki uses the Vector skin as default. Code can be found on the Github mirror.
  2. Developing a skin from zero could be a huge work/overkill. I would suggest to simply fork Vector and extend it to achieve with php the same result we are achieving right now with JavaScript.

@Kiailandi : can you confirmIs this is the skin that Wikidata uses?

Kiailandi reopened this task as Open.
  1. Mediawiki uses the Vector skin as default. Code can be found on the Github mirror.
  2. Developing a skin from zero could be a huge work/overkill. I would suggest to simply fork Vector and extend it to achieve with php the same result we are achieving right now with JavaScript.

@Kiailandi : can you confirmIs this is the skin that Wikidata uses?

Yes.

image.png (455×1 px, 90 KB)

Upon further investigation we discovered that skins are limited to menus / categories and so on and don't have effect on body content.

Based on this we will explore other options.