TatR
TatR

Reputation: 1

MediaWiki : How to add image (icon) in a sidebar for each menu if the menu is in Cyrillic?

I have Skin:Metrolook a drop-down menu with a submenu which looks like this:

image

Thus, I have several various menus with submenus in the sitebar. I want to add an individual icon before each menu. I can't assign classes orID s for each menu (as in the example here) in my MediaWiki:Metrolook.css because the menu is written in Russian language , and CSS perceives only English letters, but not Cyrillic. All my attempts to determine the ID comes down to a set of characters of this type: p-.D0.A6.D0.B2.D0.B5.D1.82.D1.8B:-list So CSS it does not perceive such symbols and also does not perceive Cyrillic. I tried to assign to in my MediaWiki:Sidebar

 <div id="cv">*Пример</div>

and write in css this combination : #p-cv :before { content: url(/img/white_tulip.png); } and .n-cv:before { content: url(/img/white_tulip.png); } and .cv:before { content: url(/img/white_tulip.png); }and #cv:before { content: url(/img/white_tulip.png); } but it doesn't work.However, page MediaWiki:Sidebar does not perceive the encoding in the menu on the page, as I understand it. However, I noticed that if write in css

#p-navigation li a:before, 
#n-Info-sur-WikiRouge a:before  { content: url(/img/white_tulip.png); }

then the icon appears in the navigation of the service menus from below At the same time, this menu is also on Cyrillic- but this menu is embedded in Mediawiki as standart.But this is just an observation. Please say how can I add icons in my case?

Upvotes: 0

Views: 412

Answers (1)

Alexander Mashin
Alexander Mashin

Reputation: 4537

If you are talking about the sidebar menu, this code should work in MediaWiki:Metrolook.css (ID and URL from my own wiki):

#n-Техподдержка a:before {
    content: url(/files/thumb/3/33/Nuvola_apps_bookcase.png/51px-Nuvola_apps_bookcase.png);
}

The corresponding line of MediaWiki:Sidebar is:

** Project:Техническая поддержка|Техподдержка

If the necessary id is encoded with full stops, the full stop should be escaped with a backslash in CSS selector:

ul#p-\.D0\.A1\.D0\.BE\.D0\.B7\.D0\.B8\.D0\.B4\.D0\.B0\.D0\.BD\.D0\.B8\.D0\.B5-list:before {
    content: url(/files/thumb/3/33/Nuvola_apps_bookcase.png/51px-Nuvola_apps_bookcase.png);
}

Both tested in MediaWiki and MetroLook 1.35; in newer versions of MetroLook the structure of the sidebar menu, and therefore, the selector, can change. But, anyway, CSS can work with Cyrillic identifiers.

Upvotes: 0

Related Questions