WiTeX icon indicating copy to clipboard operation
WiTeX copied to clipboard

Showing selected inter-language links

Open eigengrau opened this issue 10 years ago • 1 comments

I wouldn’t propose to have this in the default stylesheet, but I thought I might ask you if you knew a less combersome way of achieving this; we might then add it to the GH Wiki for interested parties. The interlanguage links are rather important to me, not only to switch quickly, but also because I’m often unsure as to what the right lemma would be in the other language. But obviously I don’t want to see the complete language list.

I have no clue about CSS, but I came up with a very convoluted way of only showing selected languages. Maybe you have some idea on how this could be done better, to add it to the Wiki. The main problem seems to be that the display property can’t be overridden for children.

What I did was exclude #mw-navigation from hiding, and I added these:

#mw-navigation > :not(#mw-panel) {
  display: none;
}

#mw-panel > :not(#p-lang) {
    display: none;  
}

#p-lang {
    background-image: none !important;
}

#p-lang > :not(div) {
    display: none;  
}

#p-lang > div > :not(ul) {
    display: none;
}

#p-lang > div > ul > *  {
    display: none;
}

#p-lang > div > ul > .interwiki-en, 
#p-lang > div > ul > .interwiki-de  {
    display: block;
}

eigengrau avatar May 19 '15 11:05 eigengrau

@eigengrau Thank you so much for your solution. Extremely useful!

simonnier avatar Aug 17 '16 15:08 simonnier