About this board

Previous discussion was archived at User talk:Jdlrobson/Archive 1 on 2015-12-18.

Skin:Lakeus’ newer version is not deployed on https://skins-demo.wmflabs.org

1
Lakejason0 (talkcontribs)

I might have deleted and recreated the 1.0.17 tag, and now the newer release of the skin is no longer deployed on it. Could you help me fix it? Thanks!

Reply to "Skin:Lakeus’ newer version is not deployed on https://skins-demo.wmflabs.org"

Skin:MediaWikiBootstrap need help to update the skin

9
Nasirkhan (talkcontribs)

Hi Jdlrobson,

I just saw that you marked the Skin:MediaWikiBootstrap as Unstable. I know it does not work even in 1.36.


I found this issue a few weeks back and tried to search the related docs to update the skin. We also talked a few months back about upgrading the skin. I am kind of frustrated that Mediawiki is updating the skin system and there is no related doc at all. If any skin developer have to discover the list of methods from the codebase, that is the other way of saying, "Do not use MediaWiki" at all!


Can you please let me know where can I find the docs and help to build a skin which works. ~~~~

Jdlrobson (talkcontribs)

I'm not sure what docs you are looking for, but the skin is not working for some time due to usage of a function deprecated a long time ago.

https://github.com/nasirkhan/mediawiki-bootstrap/pull/15 should be all that's needed to fix it. Provided you are subscribed to deprecation notices (and the deprecation notices that should appear in your server logs and in your browser), all you should need to upgrade your skin is to follow the Release notes.


If you are building a skin from scratch against current master, Manual:How to make a MediaWiki skin documents exactly what you need to do. If you have an existing skin I'm not sure what documentation you are looking for so it would help if you were more specific with your queries so I can help you.

Nasirkhan (talkcontribs)

thank you for you help.


I do not regularly follow the mediawiki releases and did not updated the skin for a long time. So, even though I know that Release notes are the best place to look into while updating the skin. You updated one method which was deprecated in 1.36 and there might be other method calls while may deprecate on 1.37 or the next release. And structurally MediaWikiBootstrap and Example/SkinLabsSkin is different.


In summary I want to update the skin to Mustache but the skin will look similar.


If I read the Manual:Skinning Part 2 and Manual:Skinning Part 3 I would be able to built a PHP based skin. But if I want to build a Mustache based skin there is not equivalent amount of doc available.


I have a number of queries, those might look silly but as I do not building the skin system I do not have much info about those. Like I installed 1.37 and installed Example skin. After that I found that the logo is not visible, but there is a file on the LocalSettings logo path. What should i do now? How to set the Favicon? how can I show the language links? will I have to do anything for RTL language wiki? how to control the footer links? what are the steps to format the categories area? I also need to add Google Fonts, Icon fonts. how to show/hide the navigation menu items, how to format those? styling the search box, add an extra class/id with that, formatting the search box results. None of these questions have answers to that Manual:How to make a MediaWiki skin doc.


If you can answer to my queries, I also can write docs and update that single page as well.

Jdlrobson (talkcontribs)

Okay lots to digest here. I think a good starting point might be a migration guide of how to migrate a SkinTemplate skin to SkinMustache. I'll commit to writing one of those as that seems like it would be useful to others.

In terms of your questions, I would say these are good questions and thanks for asking them. I've raised the ones I've understood on the Manual_talk:How_to_make_a_MediaWiki_skin and will get to them when I can.


It would be helpful to expand on your other questions with time, to understand them better.

> "what are the steps to format the categories area? I also need to add Google Fonts, Icon fonts. how to show/hide the navigation menu items, how to format those? styling the search box, add an extra class/id with that, formatting the search box results."


I'm not 100% sure what's being asked here. Provided you've setup a CSS/LESS file you can put anything you want in there, including paths to resources such as downloaded fonts or Google Font URLs. You are also free to include libraries such as Icon fonts in the declarations. ResourceLoader/Developing_with_ResourceLoader has information on how that works if that's what's needed here. You are also free in your skin to add any HTML markup you need for styling things like the search box.

Some pages that may help you with your immediate questions around languages and icons:

Nasirkhan (talkcontribs)

It would be really helpful if you can write a migration guide. When it will be ready it will be easier to prepare a doc to building a skin from scratch.


I can write my questions in details, but got confused about where to ask those! I did not asked those to Manual_talk:How_to_make_a_MediaWiki_skin as the questions are not specific to that page. Rather about those which are not included there. I asked to Project:Support desk, Discord and wikitech mailing list ( Topic:Wb1kvracyubak7se, Topic:Wb1rvgucmqffnsws, Topic:Wazztppvnjh62mo7, https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/HVS7OBF5YQEMY7MFAYRSQZNEMHJGA5VS/). Not no one have the time or knowledge to help, except you.


So first help I need is, a place where I can ask questions and get answers about MediaWiki. Should I ask everything to you, or if there is any group/ forum available?

Jdlrobson (talkcontribs)

Historically there has not been much interest in skin development for mediawiki (IMO) and a lot of the skin development does seem to happen in private. In 1.36 we began to challenge that by trying to simplify the creation process and poke existing skins to see it they were still being actively developed.

Manual_talk:How_to_make_a_MediaWiki_skin is probably the best place to ask questions as it's linked to the main page and the small group of us that does exist is at least aware of it.

Nasirkhan (talkcontribs)

I will ask questions to the Manual_talk:How_to_make_a_MediaWiki_skin page then. I hope I will be able to build a skin soon with intended customization.


I think you are not right that, people do not have interest on the skins. From my experience and issues I am facing so far, I can confidently say that people were demotivated and discouraged in a a number ways to build new skins and even using MediaWiki. This is done by the core community/staff members of MediaWiki. I asked a number of questions about some common customization needs like, logo, navigation, footer and so on. There is no answer available for those, without those answer how can someone new to the platform can build a skin?


You are the only person who is replying with some helpful information. But you are not the only one who is building and using the entire skin system. Where are others and which platform they are active in? You can check Topic:Wb1rvgucmqffnsws as a reference. The person trying to help may have the least info about the skin system. But I asked the question in the Support desk and there are a group of volunteers claim to be active there!


Wordpress is the most popular CMS and a major reason is their are docs and community member helping others and their theme/skin is easy to build/customize. So far the Wordpress websites I visit every day I probably not seen any site with the default theme, where as a big number of mediawiki sites are using default skin. It can not be the lack of interest to developing new skins.

Jdlrobson (talkcontribs)

There is no team at the Wikimedia Foundation supporting skins and no skin community site (wordpress on the other hand does that).

I am not questioning that people want to build skins and are put off from doing so, I am saying we do not have a community in the same way. The skins that are built are seldom shared as there is nowhere obvious to share them. Https://skins.wmflabs.org is an experiment in seeing what happens when skins are showcased, but this is being done by me in a volunteer capacity.

I have begun your migration guide. Questions at this early stage are welcomed Manual:How to make a MediaWiki skin/Migrating SkinTemplate based skins to SkinMustache

Nasirkhan (talkcontribs)

thanks for starting the migration guide. I will add my questions to Manual_talk:How_to_make_a_MediaWiki_skin and you can pick which you want to add in the migration guide.


I know there is no separate team to support skin, but my point was a skin in a part of MediaWiki not some outside thing. I support MediaWiki means, I support MediaWiki and all the core components including extension & skin systems.

Reply to "Skin:MediaWikiBootstrap need help to update the skin"

[WMF Board of Trustees - Call for feedback: Community Board seats] Meetings with MediaWiki and Wikitech communities

1
MediaWiki message delivery (talkcontribs)

The Wikimedia Foundation Board of Trustees is organizing a call for feedback about community selection processes between February 1 and March 14. While the Wikimedia Foundation and the movement have grown about five times in the past ten years, the Board’s structure and processes have remained basically the same. As the Board is designed today, we have a problem of capacity, performance, and lack of representation of the movement’s diversity. Our current processes to select individual volunteer and affiliate seats have some limitations. Direct elections tend to favor candidates from the leading language communities, regardless of how relevant their skills and experience might be in serving as a Board member, or contributing to the ability of the Board to perform its specific responsibilities. It is also a fact that the current processes have favored volunteers from North America and Western Europe. In the upcoming months, we need to renew three community seats and appoint three more community members in the new seats. This call for feedback is to see what processes can we all collaboratively design to promote and choose candidates that represent our movement and are prepared with the experience, skills, and insight to perform as trustees?

In this regard, two rounds of feedback meetings are being hosted to collect feedback from the technical communities in Wikimedia. Two rounds are being hosted with the same agenda, to accomodate people from various time zones across the globe. We will be discussing ideas proposed by the Board and the community to address the above mentioned problems. Please sign-up according to whatever is most comfortable to you. You are welcome to participate in both as well!

Also, please share this with other volunteers who might be interested in this. Let me know if you have any questions. KCVelaga (WMF), 14:37, 21 February 2021 (UTC)

Reply to "[WMF Board of Trustees - Call for feedback: Community Board seats] Meetings with MediaWiki and Wikitech communities"
WikiForMen (talkcontribs)

Hi, I have something like this:

  • resources
    • css
    • images
      • de
        • Donate_Button.gif
      • en
        • Donate_Button.gif
      • es
        • Donate_Button.gif
      • fr
        • Donate_Button.gif

How can I prove, that "it/Donate_Button.gif" does not exist? --WikiForMen (talk) 13:49, 14 January 2021 (UTC)

Reply to "Prove, if image is present"
WikiForMen (talkcontribs)
Jdlrobson (talkcontribs)
Jdlrobson (talkcontribs)

For Ad1 and AD2 could you use Manual:Hooks/SkinAfterPortlet to add HTML to an existing menu? I think all the Wikimedia skins should support that, and if not that's a bug.

You'd need to check $portlet parameter to check if its AD1 or AD2

WikiForMen (talkcontribs)

Hook SkinAfterPortlet is to add additional text to the portlet, but NOT to modify the label of the portlet, I guess?

Jdlrobson (talkcontribs)
WikiForMen (talkcontribs)

I see. Now I can explain you, why this will not work. The labels should be translated, if you select an other language in personal settings. Depending on the purpose, the headings should be advertisement, event notice or hint. According to your suggestion, I would now have to change the entry in the navigation bar each time... I would like to avoid precisely this annoying workload.

Hook "SidebarBeforeOutput": If there are two advertising blocks, both should be called Advertisment. How should I differentiate when assigning the HTML snippet? Can this work?

This is the reason why I enter AD1 and AD2 as markers in the sidebar, I then have distinguishable markers to which I can assign an HTML snippet and in the hack of the skin I then bend the markers AD1 and AD2 to the labels, according to the variables $wgSidebarAd1Type and $wgSidebarAd2Type. And it is precisely this that cannot be implemented with all the available hooks.

Nor is it a question of creating a new "portal" SOMEWHERE. The advertising blocks must also be positioned appropriately in the sidebar in the sidebar. But this is precisely the purpose of the AD1 and AD2 markers.

That's why I decided to drill out the skins, because the task cannot be solved with the Mediawiki hooks.

And all "examples" of the hook shit going with the test/href scheme. Actually, it still needs its custom class specifications. I have to use tricks to display the advertising blocks appropriately (background colour, spacing, border if necessary).--WikiForMen (talk) 21:56, 2 January 2021 (UTC)

WikiForMen (talkcontribs)
Jdlrobson (talkcontribs)

> That's why I decided to drill out the skins, because the task cannot be solved with the Mediawiki hooks.


I'm not sure I completely understand the problem here, but I'm still fairly confident you can achieve what you are doing with hooks and if it's not we should update those hooks to make it possible.


> I would like to avoid precisely this annoying workload.

HTML should be cached for each time it's generated or were you talking about something other than performance here? You can use internal caching methods if what you are doing here is very intensive but it doesn't seem that way.


> The advertising blocks must also be positioned appropriately in the sidebar in the sidebar. But this is precisely the purpose of the AD1 and AD2 markers.

And that's fine. Putting AD1 and AD2 in MediaWiki:Sidebar will create 2 elements with id's #p-AD1 and #p-AD2. These will have headings translateable at `MediaWiki:aD1` and `MediaWiki:aD2`, but can also be replaced with the SidebarBeforeOutput. Using Php array methods you can retain the same positioning with a custom heading by doing something like this...


e.g.

$wgHooks['SidebarBeforeOutput'][] = function ( $skin, &$bar ) {
  $newbar = [];
  foreach( $bar as $key => $menu ) {
    if ( $key === 'AD1' ) { 
       $newbar[ 'My custom label or message key' ] = $menu;
    } else {
       $newbar[$key] = $menu;
    }
  }
  $bar = $newbar;
};


If the above doesn't help can you provide a bug report-style account of what you are trying to do here?


e.g.

// Do this...

// Run this code

// Expected result..

// Actual result..

WikiForMen (talkcontribs)
$wgHooks['SidebarBeforeOutput'][] = function ( $skin, &$bar ) {
  $newbar = [];
  foreach( $bar as $key => $menu ) {
    if ( $key === 'AD1' ) { 
       $newbar[ 'My custom label or message key' ] = $menu;
    } else {
       $newbar[$key] = $menu;
    }
  }
  $bar = $newbar;
};

is not working because of a serious problem.

$wgHooks['SidebarBeforeOutput'][] = function ( $skin, &$bar ) {
  $newbar = [];
  foreach( $bar as $key => $menu ) {
    if ( $key === 'AD1' ) { 
       $newbar[ 'advertising' ] = $menu; // <== first set
    } else if ( $key === 'AD2' ) { 
       $newbar[ 'advertising' ] = $menu; // <== overriding first set
    } else {
       $newbar[$key] = $menu;
    }
  }
  $bar = $newbar;
};

You see the issue? With two ad blocks one will override the other. :-(

WikiForMen (talkcontribs)

I did another try with array_splice:

public static function onSkinTemplateOutputPageBeforeExec(
		SkinTemplate &$skin,
		QuickTemplate &$tpl
	) {
		global $wgSidebarAd1Code, $wgSidebarAd1Style, $wgSidebarAd1Type;
		global $wgSidebarAd2Code, $wgSidebarAd2Style, $wgSidebarAd2Type;

		$_key1 = empty( $wgSidebarAd1Type ) ? 'advertising' : $wgSidebarAd1Type;
		$_key2 = empty( $wgSidebarAd2Type ) ? 'advertising' : $wgSidebarAd2Type;

		// Transfer keys 'AD1' and 'AD2' to labels
		$_modified = false;
		$offset = 0;
		$sidebar_new = $tpl->data['sidebar'];

		foreach ( $tpl->data['sidebar'] as $key => $value ) {
			switch ( $key ) {
				case 'AD1' :
					if ( empty( $wgSidebarAd1Code ) ) {
						// Deactivate marker 'AD1' if $wgSidebarAd1Code is not defined
						$sidebar_new['AD1'] = false;
					} else {
						// Replace array with the key 'AD1' with key $wgSidebarAd1Type
						array_splice( $sidebar_new, $offset, 1, [ $_key1 => $wgSidebarAd1Code ] );
					}
					$_modified = true;
				break;
				case 'AD2' :
					if ( empty( $wgSidebarAd2Code ) ) {
						// Deactivate marker 'AD1' if $wgSidebarAd1Code is not defined
						$sidebar_new['AD2'] = false;
					} else {
						// Replace array with the key 'AD2' with key $wgSidebarAd2Type
						array_splice( $sidebar_new, $offset, 1, [ $_key2 => $wgSidebarAd2Code ] );
					}
					$_modified = true;
				break;
			}
			++$offset;
		}
		if ( $_modified ) {
			$tpl->set( 'sidebar', $sidebar_new );
		}
	}
Jdlrobson (talkcontribs)

> You see the issue? With two ad blocks one will override the other. :-(

You'll need two unique message keys that translate to the heading. Use advertising-1 and advertising-2 and define those messages in i18n/en.json

Appending ?uselang=qqx to url will show you message keys for the page.

WikiForMen (talkcontribs)

That's dirty and by doubling the same entries an increase of the overhead, but I had already thought of that... ;-)

Jdlrobson (talkcontribs)

Why is that dirty? And what overhead are you exactly referring to here? I don't see any problem with having 2 messages using the same text. I've seen this in other extensions. The context is different. See https://github.com/wikimedia/mediawiki/blob/master/languages/i18n/en.json#L148 for example.

The benefit of turning these into translatable messages is that you give the site owner control over those headings - I imagine some people may want to blank them for example and not have a heading.

Also please consider somebody reading with a screen reader. Two portals with the same heading is going to be confusing to those users, so another use case might be translating those to "advertisement 1" and "advertisement 2".

WikiForMen (talkcontribs)
Jdlrobson (talkcontribs)

Nice! Seems easier to maintain than forking the entire skin, though? :) Using LESS might make that a bit easier to maintain as you'd be able to nest all the rules.


e.g.


#p-wimaadvertising-advertising,

#p-wimaadvertising-advertising2

....

#p-wimaadvertising-hint2 {

.body {

   background-color: #ffffff;

   margin-left: -.7em;

   margin-top: .3em;

   padding: 0 0 .1em 0;

   width: auto;

}

}

WikiForMen (talkcontribs)

I'm not that IN with css and thanks for the help and suggested solutions. :-) --WikiForMen (talk) 01:20, 6 January 2021 (UTC)

WikiForMen (talkcontribs)

It would be less "dirty" if it was considered that #2 is only used if both are advertisements or event notes ... But at least it works now. Thanks for the help. May it be helpful for someone. :-) --WikiForMen (talk) 00:13, 3 January 2021 (UTC)

Reply to "Using hooks"

Page Previews: wikipage.content hook

4
Enterprisey (talkcontribs)

Hi! I'm writing a user script that adds new links to a page, and would like to enable Page Previews handlers for those links. Per this change, it looks like the wikipage.content hook won't work, and I've been looking through the code and can't see any other way to do this. Would that be correct? (And sorry if this is the wrong venue - I wasn't sure opening a task on the Page-Previews phab workboard was a good idea.)

Jdlrobson (talkcontribs)

The delegate event handler we use means any link no matter when it is added will trigger a page preview so no hooks are needed here.

The link to be considered valid however must have a link and title attribute and an associated page preview associated with the URL. This code for example will trigger a page preview:

$('<a title="Hello" href="/wiki/Hello">hello</a>').prependTo('#mw-content-text')
Enterprisey (talkcontribs)

Thank you! I tried it, but I'm on a Special-namespace page. Will it only work in mainspace?

Jdlrobson (talkcontribs)
Reply to "Page Previews: wikipage.content hook"
X-Savitar (talkcontribs)
The Special Barnstar
For all the work you do to make Mobile Web an awesome reading space for web readers :) X-Savitar (talk) 00:24, 7 July 2020 (UTC)
Reply to "A barnstar for you!"
Serhio Magpie (talkcontribs)

I apologize for being so rude. Your comment is a fair point which has place to be. Sorry again.

Jdlrobson (talkcontribs)

Oh not at all. My fault for not being more careful with my editing.

I just want to make sure I play my part in keeping the creative energy flowing. I think the existing logo is outdated and I'm keen to any sort of change here.

On reflection I think it's a shame that we jumped into voted so early. There are lots of good ideas in all the logos.

Serhio Magpie (talkcontribs)

I completely agree with you. We are only at the brainstorm stage now and searching for ideas. Thanks.

difference not clear (?) between tags 'mobile edit' 'mobile web edit'

2
Wladek92 (talkcontribs)
mobile edit	Mobile edit	Edit made from mobile (web or app)	72,244 changes
mobile web edit	Mobile web edit	Edit made from mobile web site

Hi Jon , referring to Topic:Viy7jkhlv2w5x5s2 and apart of 'This is expected behaviour.' answer from Forestier I still do not understand the difference between the tags. The number of modifications being the same for both tags, they seem redundant. One says "Edit made from mobile web site" (a) that means I have used the 'Mobile version' on my desktop for my translations (and its true). Other says "Edit made from mobile (web or app)" which covers "Edit made from mobile web" (b), and "Edit made from mobile app)"(c). I understand (b) seems the same as (a) and I wonder what are the cases "Mobile edit" which ARE NOT "Mobile web edit" ? ...

Since I make translations using the web (Special:Translate), the translated text (that means the contents) is the same when viewed on a desktop or a tablette. If one decides to cancel all updates "Mobile edit" there is a risk my translations are lost. Isn't there a warning to write for translators against this situation ?

Thanks.

Christian FR (talk) 11:50, 21 March 2020 (UTC)

Jdlrobson (talkcontribs)

Mobile edit is also used on edits from mobile phone applications (not mobile domain) e.g. Android and iPhone.

Consider an edit with the following tags:

Tags: Mobile edit, Mobile app edit, Android app edit

Reply to "difference not clear (?) between tags 'mobile edit' 'mobile web edit'"

Hi Jon, Pagebanner and Women in Red.

2
Victuallers (talkcontribs)

We have 5-600 banners that we use each day on Twitter and now on our en:wiki talk page. We use some basic code to turn over to a new "Woman of the Day" each day. However our banners look no where near as good as the ones used on Wikivoyage and I'm wondering if it is possible/easy to use PageBanner on en:wiki?

Our woman of the day currently looks like this. Could this appear neater? We have run 150 editathons to date and your code would smarten us up a bit. Can you point us to how we can achieve this. ~~~~

Jdlrobson (talkcontribs)

I'm not sure if the There's no constraints in turning on Extension:WikidataPageBanner on enwiki for a certain namespace. To have it enabled it would need to follow the site request policy.

You could always enable it for the project or talk namespace, experiment with it and turn it off if you find it is not for you.

You can also experiment with it on this test wiki page: https://en.wikivoyage.beta.wmflabs.org/wiki/Women_in_red_test - please use a throwaway account if you decide to experiment and certainly don't use your Wikipedia password on any new account you create there!

Have fun!

Reply to "Hi Jon, Pagebanner and Women in Red."