Hi,
it would be nice to have the same icons following an internal media-link as the ones displayed behind external links:
e.g.: * [http://localhost/Example.pdf doc.pdf] {pdf-icon-15x15.gif} * [[Media:Example.pdf|doc.pdf]] {**same as above**}
How could I achieve this?
TIA for any hint, Peter
Peter Velan wrote:
Hi,
it would be nice to have the same icons following an internal media-link as the ones displayed behind external links:
e.g.:
- [http://localhost/Example.pdf doc.pdf] {pdf-icon-15x15.gif}
- [[Media:Example.pdf|doc.pdf]] {**same as above**}
How could I achieve this?
TIA for any hint, Peter
At monobook/main.css you will find
#bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"], #bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"], #bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"], .link-document { background: url("document.png") center right no-repeat; padding: 0 12px; }
remove the ".external" from them to apply to any link in the content.*
Use the same procedure for the other extensions.
*Instead of editing the css files you can copy the modified text to MediaWiki:monobook.css
am 08.08.2009 00:35 schrieb Platonides:
Peter Velan wrote:
it would be nice to have the same icons following an internal media-link as the ones displayed behind external links:
e.g.:
- [http://localhost/Example.pdf doc.pdf] {pdf-icon-15x15.gif}
- [[Media:Example.pdf|doc.pdf]] {**same as above**}
How could I achieve this?
At monobook/main.css you will find
#bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"], #bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"], #bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"], .link-document { background: url("document.png") center right no-repeat; padding: 0 12px; }
remove the ".external" from them to apply to any link in the content.*
Great, this works! But I would prefer to go this way ...
*Instead of editing the css files you can copy the modified text to MediaWiki:monobook.css
... instead, as this will survive coming MediaWiki upgrades.
Unfortunately, if I put this into MediaWiki:monobook.css then the iconic image is expected to be located in wiki's root :-(
For now, I symlinked the required icons into wiki's root, but this will possibly be killed by a future MediaWiki upgrade, too.
Peter
Peter Velan wrote:
*Instead of editing the css files you can copy the modified text to MediaWiki:monobook.css
... instead, as this will survive coming MediaWiki upgrades.
Unfortunately, if I put this into MediaWiki:monobook.css then the iconic image is expected to be located in wiki's root :-(
For now, I symlinked the required icons into wiki's root, but this will possibly be killed by a future MediaWiki upgrade, too.
Peter
change url("document.png") to a full url, ie. url("http://www.example.com/w/skins/monobook/document.png") or url("/w/skins/monobook/document.png")
am 08.08.2009 14:34 schrieb Platonides:
Peter Velan wrote:
*Instead of editing the css files you can copy the modified text to MediaWiki:monobook.css
... instead, as this will survive coming MediaWiki upgrades.
Unfortunately, if I put this into MediaWiki:monobook.css then the iconic image is expected to be located in wiki's root :-(
For now, I symlinked the required icons into wiki's root, but this will possibly be killed by a future MediaWiki upgrade, too.
Peter
change url("document.png") to a full url, ie. url("http://www.example.com/w/skins/monobook/document.png") or url("/w/skins/monobook/document.png")
Thank you very much for your very valuable hints; above method works as expected!
But now I detected two other problems:
--- Still differences between internal/external ---
I changed the iconic images for pdf, audio, video, (and added some more for .odp, odt, .zip, etc.), but the new CSS-setting in "MediaWiki:Common.css" is used for styling of internal links only. external links are still styled with data found in main.css.
Only after completely commenting out "a.external ..."-section in /skin/modern/main.css the internal and external links are styled identically.
--- Works not in monobook ---
My own prefered skin is "modern" (but the majority of our users goes with monobook standard). I was not able to achieve my goals in monobook :-( Whatever I tried, not one link is shown with epected style.
I took a deeper look to the brwoser output with Firebug and I see that in "modern" the content of MediaWiki:Common.css is read, but in monobook it looks like there's no MediaWiki:Common.css and even after I copied the news stuff into /skins/monobook/main.css I don't see the expected result.
What I'm doing wrong?
Peter
Peter Velan wrote:
--- Still differences between internal/external ---
I changed the iconic images for pdf, audio, video, (and added some more for .odp, odt, .zip, etc.), but the new CSS-setting in "MediaWiki:Common.css" is used for styling of internal links only. external links are still styled with data found in main.css.
Only after completely commenting out "a.external ..."-section in /skin/modern/main.css the internal and external links are styled identically.
The declarations with .external are more specific, that's why they're being used, You can make your define work for both, ie. #bodyContent a.external[href $=".pdf"], #bodyContent a[href $=".pdf"]...
--- Works not in monobook ---
My own prefered skin is "modern" (but the majority of our users goes with monobook standard). I was not able to achieve my goals in monobook :-( Whatever I tried, not one link is shown with epected style.
I took a deeper look to the brwoser output with Firebug and I see that in "modern" the content of MediaWiki:Common.css is read, but in monobook it looks like there's no MediaWiki:Common.css and even after I copied the news stuff into /skins/monobook/main.css I don't see the expected result.
What I'm doing wrong?
Peter
Bypass your cache.
am 10.08.2009 00:53 schrieb Platonides:
Peter Velan wrote:
--- Still differences between internal/external ---
I changed the iconic images for pdf, audio, video, (and added some more for .odp, odt, .zip, etc.), but the new CSS-setting in "MediaWiki:Common.css" is used for styling of internal links only. external links are still styled with data found in main.css.
Only after completely commenting out "a.external ..."-section in /skin/modern/main.css the internal and external links are styled identically.
The declarations with .external are more specific, that's why they're being used, You can make your define work for both, ie. #bodyContent a.external[href $=".pdf"], #bodyContent a[href $=".pdf"]...
Works - thanks!
--- Works not in monobook ---
My own prefered skin is "modern" (but the majority of our users goes with monobook standard). I was not able to achieve my goals in monobook :-( Whatever I tried, not one link is shown with epected style.
I took a deeper look to the brwoser output with Firebug and I see that in "modern" the content of MediaWiki:Common.css is read, but in monobook it looks like there's no MediaWiki:Common.css and even after I copied the news stuff into /skins/monobook/main.css I don't see the expected result.
What I'm doing wrong?
Bypass your cache.
Whatever I tried to eliminate cache-related things, I failed! Then I discovered this:
In modern/main.css the related styles defined like ...
#mw_content a[...]
... in all *other* supplied skins (including monobook) the definitions look line ...
#bodyContent a[...]
I duplicated every "#mw_content a[...]"-definition (needed for modern) in Common.css as "#bodyContent a[...]" (needed for all other skins) and finally it works :-)
Could somebody explain, why there's different style definitions (#mw_content vs #bodyContent)?
Peter
mediawiki-l@lists.wikimedia.org