Fandom

Community Central

Admin Forum:User highlight code

19,031pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

This Forum has been archived

Forums: Admin Central Index Technical Help User highlight code
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.


Hello, I'm using the highlight code and I asked if it was possible to restrict the code application to wikiactivity/recentchanges/history/contribution, then I got this answer:


There are 2 sort of ways:
  1. Grab the code (not the import) and copy it 2 times (not possible with history)
    To the first copy you will add
    .page-Special_RecentChanges
    to the beggining of each class/id call.
    Repeat the same for the other copy
    .page-Special_WikiActivity
  2. The other option is to call it by JavaScript
 if ( wgCanonicalSpecialPageName === 'WikiActivity' || wgCanonicalSpecialPageName === 'Recentchanges' || wgAction === 'history') {
 	importStylesheetPage('Highlight/code.css', 'dev');
 }
Thought the drawback is. If the user has disable its JS the names will not be highlight.
--Cizagna (Discusión) • HelperCentral hispana 10:11, 06 September 2011 (UTC)

I tried the JS code but didn't work, I used this code:

 if ( wgCanonicalSpecialPageName === 'WikiActivity' || wgCanonicalSpecialPageName === 'Recentchanges' || wgAction === 'history') {
 	importStylesheetPage('MediaWiki:Common.css/highlight.css');
 }

Since I have my personal colors. Also for MediaWiki:Common.css, how can I make an "import command" like I do with js? (to import a css from a subpage). leviathan_89 22:01, 7 September, 2011 (UTC)

No one? leviathan_89 21:22, 13 September, 2011 (UTC)

Not sure about that, but if I recall correctly, you need define both the page and the wiki you want to import the sheet with importStylesheetPage from, like this:
importStylesheetPage('MediaWiki:Common.css/highlight.css', 'dev'); or
importStylesheetPage('MediaWiki:Common.css/highlight.css', 'onepiece'); or
importStylesheetPage('MediaWiki:Common.css/highlight.css', 'YOURWIKI'); depending on where the code is. But don't quote me on that. Sovq 07:33, September 14, 2011 (UTC)

That works! Thank you, I also suggest this to whoever use this type of code, this way only the link in those pages are "marked" otherwise every links (tabs, signatures,...) will be marked. leviathan_89 09:46, 14 September, 2011 (UTC)

Also on Fandom

Random Wiki