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.
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:
- Grab the code (not the import) and copy it 2 times (not possible with history)
- To the first copy you will add to the beggining of each class/id call.
.page-Special_RecentChanges
- Repeat the same for the other copy
.page-Special_WikiActivity
- To the first copy you will add
- The other option is to call it by JavaScript
- Grab the code (not the import) and copy it 2 times (not possible with history)
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) • Helper • Central 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');
orimportStylesheetPage('MediaWiki:Common.css/highlight.css', 'onepiece');
orimportStylesheetPage('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)