GOG.com Enhancement Project
ProjectForumTalk
64/680

Langbar template: ideas and extension requests

Fragment of a discussion from User talk:Andytizer
Jump to: navigation, search
Sponsored links

I think I fixed this now, Array had been loaded after Vector, and is working.

Andytizer (talk)11:32, 30 April 2012

Great, thanks. I was wondering where it had gone tbh :P

Masked Turk Ap lg.svg ([[U 16:13, 30 April 2012

These extensions have worked like a charm in my template: User:Masked_Turk/Sandbox/Langbar

{{Langbar}}

It'll seek out direct subpages and display them in list-form. I just need feedback on design and styling now that the functionality is all there.

Masked Turk Ap lg.svg (Talk | Edits)20:50, 30 April 2012

Very nice :). I'd like to implement this straight away. It looks amazing :). Other solutions I have investigated have been much more complicated, involving interwikis or bots to maintain the subpage links, etc. so this is really a godsend.

In terms of style, I have disabled the background hover because I don't think it quite looks right. I also think a character seperator like '·' works better than | which takes too much vertical space.

I have tried to implement the {{Langbar|main}} on the Home page. I have also implemented the Polski page: Home/Polski, but it's not showing up on the main page. Can you take a look please?

Andytizer (talk)08:42, 1 May 2012

Unfortunately it seems that Extension:Subpage_Fun does not recognise the main article's sub-pages, which means we'll probably have to use a different method for the main article's English page: sorry about that.

I've altered the stylings to your description as best I can, can you check it's as you imagined?

Masked Turk Ap lg.svg (Talk | Edits)15:42, 1 May 2012

If it's just the one-off, then we could simply create a custom table to fit on the Home page.

Andytizer (talk)15:57, 1 May 2012
 
 

Another thought is about category translation - what's the best way to handle this? I'm assuming it'll function in the same way as pages, so I can create Game/Polski and put the Langbar in the category page. Then this will display the game pages written in Polish.

Andytizer (talk)09:03, 1 May 2012

You just reminded me about categories, so I've added Category:Articles with translations and [[:{{{language name}}} translations]] to the relevant parts of the template.

Regarding category pages... hmm, the template looks for subpages of the article it's in, so if you put {{Langbar|main}} in Category:Games, the template will show the link to the Polish version of the category page. I could amend the template to categorise Polish (etc.) translations in Category:Games/Polski, which would achieve what I think you're after?

Masked Turk Ap lg.svg (Talk | Edits)15:45, 1 May 2012

Yes that would help thank you :).

Andytizer (talk)15:56, 1 May 2012
 

Thanks that would be very helpful.

Andytizer (talk)15:58, 1 May 2012
Edited by 2 users.
Last edit: 13:27, 16 April 2013

Right, done that. Problem #2 with the extension is that it doesn't seem to notice subpages in Category:, Template: etc. either. Unless I'm doing it wrong. I've asked the extension creator over at mediawiki.

For now though, workaround: the category translations appear as sub-categories on the page: see Category:Games for e.g.

Masked Turk Ap lg.svg (Talk | Edits)17:56, 1 May 2012

Let's wait for a response - it must be a switch to allow for these namespaces. If you don't hear anything back in a couple of days we can do a workaround.

Andytizer (talk)22:00, 1 May 2012

Right, I *think* I have a fix.

Delve into LocalSettings.php and append the following line to the end of the file:

$wgNamespacesWithSubpages = array_fill(0, 500, true); //enables subpages for all articles, so the extension works!
Masked Turk Ap lg.svg (Talk | Edits)18:42, 8 May 2012

I've added this in now, let me know if it works!

Andytizer (talk)18:45, 8 May 2012

See for yourself ^_^ - Just going about removing the pl from the list, through the ingenious use of regular expression commands. Shouldn't take long.

Masked Turk Ap lg.svg (Talk | Edits)18:58, 8 May 2012
 

Have a look for yourself :)

Masked Turk Ap lg.svg (Talk | Edits)19:14, 8 May 2012

Great, works well on the home screen. It doesn't appear to be working on the category page though? http://pcgamingwiki.com/wiki/Category:Game

Is there any way to have the full list of languages displayed whether it is Home or Home/Polski? Is there an alternative to a link for 'Return to the English language article'?

Andytizer (talk)22:31, 8 May 2012
  1. Category fixed. Forgot to add the : for categories, so it added them to the categories instead of displaying them as links :P
  2. Show list of langs in subpages: Sorted. Template will link other langs if available, otherwise will link back to route article. Took quite a bit of rearrangement :P
Masked Turk Ap lg.svg (Talk | Edits)23:30, 8 May 2012
 
 
 
 
 
 
 
 
 
 
 
 
ELECTRONIC ARTS, INC. (Origin Store)
Personal tools

Variants
Actions
Navigation
Wiki
Community
Toolbox