Hi,
I would like to use separate style sheets for different namespaces. I found this in MonoBook.php:
<?php if($this->data['pagecss']) { ?><style type="text/css"><?php $this->html('pagecss') ?></style> (line 96 in 1.15)
could there be a similar function? Something like: "If there is a Mediawiki page called {{NAMESPACE}}.css, use it"...?
thanks
Bernhard
I don't believe there's a specific namespace css but you can add specific css for a namespace in your skin's css file. Each namespace has a specific class, i.e ns-0, ns-14. You can find them by looking at the source code.
On Sat, Apr 10, 2010 at 12:43 PM, Scheid, Bernhard < Bernhard.Scheid@oeaw.ac.at> wrote:
Hi,
I would like to use separate style sheets for different namespaces. I found this in MonoBook.php:
<?php if($this->data['pagecss']) { ?><style type="text/css"><?php
$this->html('pagecss') ?></style> (line 96 in 1.15)
could there be a similar function? Something like: "If there is a Mediawiki page called {{NAMESPACE}}.css, use it"...?
thanks
Bernhard _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Yes, I know, but I will have quite a lot of namespaces (I use them as "chapters" to organize content) and your method would become quite cumbersome. I wonder whether I could create css sheets that could be called according to the namespace.
Bernhard ________________________________________ Von: mediawiki-l-bounces@lists.wikimedia.org [mediawiki-l-bounces@lists.wikimedia.org] im Auftrag von Patrick Flaherty [patrick.flaherty@taighde.com] Gesendet: Samstag, 10. April 2010 19:36 An: MediaWiki announcements and site admin list Betreff: Re: [Mediawiki-l] css for namespaces
I don't believe there's a specific namespace css but you can add specific css for a namespace in your skin's css file. Each namespace has a specific class, i.e ns-0, ns-14. You can find them by looking at the source code.
On Sat, Apr 10, 2010 at 12:43 PM, Scheid, Bernhard < Bernhard.Scheid@oeaw.ac.at> wrote:
Hi,
I would like to use separate style sheets for different namespaces. I found this in MonoBook.php:
<?php if($this->data['pagecss']) { ?><style type="text/css"><?php
$this->html('pagecss') ?></style> (line 96 in 1.15)
could there be a similar function? Something like: "If there is a Mediawiki page called {{NAMESPACE}}.css, use it"...?
thanks
Bernhard _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Scheid, Bernhard wrote:
Yes, I know, but I will have quite a lot of namespaces (I use them as "chapters" to organize content) and your method would become quite cumbersome. I wonder whether I could create css sheets that could be called according to the namespace.
Bernhard
How much will you be customizing each namespace? Remember that the C stands for Cascading. Typically you would make very few changes on each namespace, applying once some rules to a set of namespaces.
I wanted to do something similar and received the following solution: https://bugzilla.wikimedia.org/show_bug.cgi?id=22552
So you could do something like this in mediawiki:common.css:
importStylesheet('mediawiki:mystyle' + wgCanonicalNamespace + '.css');
and then create mediawiki:mystyleUser.css, mediawiki:mystyleCategory.css, etc.
DanB
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Saturday, April 10, 2010 6:00 PM To: mediawiki-l@lists.wikimedia.org Subject: Re: [Mediawiki-l] css for namespaces
Scheid, Bernhard wrote:
Yes, I know, but I will have quite a lot of namespaces (I use them as "chapters" to organize content) and your method would become quite cumbersome. I wonder whether I could create css sheets that could be called according to the namespace.
Bernhard
How much will you be customizing each namespace? Remember that the C stands for Cascading. Typically you would make very few changes on each namespace, applying once some rules to a set of namespaces.
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Sounds interesting, I'll try it out...
Bernhard
-----Ursprüngliche Nachricht----- Von: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] Im Auftrag von Daniel Barrett Gesendet: Montag, 12. April 2010 17:51 An: MediaWiki announcements and site admin list Betreff: Re: [Mediawiki-l] css for namespaces
I wanted to do something similar and received the following solution: https://bugzilla.wikimedia.org/show_bug.cgi?id=22552
So you could do something like this in mediawiki:common.css:
importStylesheet('mediawiki:mystyle' + wgCanonicalNamespace + '.css');
and then create mediawiki:mystyleUser.css, mediawiki:mystyleCategory.css, etc.
DanB
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Saturday, April 10, 2010 6:00 PM To: mediawiki-l@lists.wikimedia.org Subject: Re: [Mediawiki-l] css for namespaces
Scheid, Bernhard wrote:
Yes, I know, but I will have quite a lot of namespaces (I use them as "chapters" to organize content) and your method would become quite cumbersome. I wonder whether I could create css sheets that could be called according to the namespace.
Bernhard
How much will you be customizing each namespace? Remember that the C stands for Cascading. Typically you would make very few changes on each namespace, applying once some rules to a set of namespaces.
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Seems to work only with mediawiki:common.js, though, which is sad since it makes styles dependent on js functionality. But at least a good way to add sophisticated js...
B.
-----Ursprüngliche Nachricht----- Von: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] Im Auftrag von Daniel Barrett Gesendet: Montag, 12. April 2010 17:51 An: MediaWiki announcements and site admin list Betreff: Re: [Mediawiki-l] css for namespaces
I wanted to do something similar and received the following solution: https://bugzilla.wikimedia.org/show_bug.cgi?id=22552
So you could do something like this in mediawiki:common.css:
importStylesheet('mediawiki:mystyle' + wgCanonicalNamespace + '.css');
and then create mediawiki:mystyleUser.css, mediawiki:mystyleCategory.css, etc.
DanB
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Saturday, April 10, 2010 6:00 PM To: mediawiki-l@lists.wikimedia.org Subject: Re: [Mediawiki-l] css for namespaces
Scheid, Bernhard wrote:
Yes, I know, but I will have quite a lot of namespaces (I use them as "chapters" to organize content) and your method would become quite cumbersome. I wonder whether I could create css sheets that could be called according to the namespace.
Bernhard
How much will you be customizing each namespace? Remember that the C stands for Cascading. Typically you would make very few changes on each namespace, applying once some rules to a set of namespaces.
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Yes, you have to put the line into mediawiki:common.js (not .css, sorry). But it does include stylesheets. DanB
2010/4/11 Scheid, Bernhard Bernhard.Scheid@oeaw.ac.at
Hi,
I would like to use separate style sheets for different namespaces. I found this in MonoBook.php:
<?php if($this->data['pagecss']) { ?><style type="text/css"><?php
$this->html('pagecss') ?></style> (line 96 in 1.15)
could there be a similar function? Something like: "If there is a Mediawiki page called {{NAMESPACE}}.css, use it"...?
thanks
Bernhard _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
hmm. What about 1.16?
Hyeon Bae wrote:
2010/4/11 Scheid, Bernhard Bernhard.Scheid@oeaw.ac.at
Hi,
I would like to use separate style sheets for different namespaces. I found this in MonoBook.php:
<?php if($this->data['pagecss']) { ?><style type="text/css"><?php
$this->html('pagecss') ?></style> (line 96 in 1.15)
could there be a similar function? Something like: "If there is a Mediawiki page called {{NAMESPACE}}.css, use it"...?
thanks
Bernhard
hmm. What about 1.16?
It hasn't been released yet.
Sorry for yet another small problem: I discovered that it should be possible to turn the page subtitle (which is usually hidden by CSS) into a good way to show "breadcrumbs" adding some magic words to MediaWiki:Tagline. The only problem: Links are not parsed correctly, neither in Wikicode nor in HTML (actually both ways are not parsed at all).
Example: {{SITENAME}} {{#if: {{NAMESPACE}} |
{{NAMESPACE}}
}}
{{BASEPAGENAME}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2 }} |
{{#titleparts: {{PAGENAME}} | 1 | 2 }}
}} {{#if: {{#titleparts: {{PAGENAME}} | 1 | 3 }} |
{{#titleparts: {{PAGENAME}} | 1 | 3 }}
}}
Ideally, something like [[Main Page|{{SITENAME}}]], etc. should work. Any solution?
Thx
Bernhard
ElScheid, Bernhard wrote:
Sorry for yet another small problem: I discovered that it should be possible to turn the page subtitle (which is usually hidden by CSS) into a good way to show "breadcrumbs" adding some magic words to MediaWiki:Tagline. The only problem: Links are not parsed correctly, neither in Wikicode nor in HTML (actually both ways are not parsed at all).
Example: {{SITENAME}} {{#if: {{NAMESPACE}} |
{{NAMESPACE}}
}}
{{BASEPAGENAME}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2 }} |
{{#titleparts: {{PAGENAME}} | 1 | 2 }}
}} {{#if: {{#titleparts: {{PAGENAME}} | 1 | 3 }} |
{{#titleparts: {{PAGENAME}} | 1 | 3 }}
}}
Ideally, something like [[Main Page|{{SITENAME}}]], etc. should work. Any solution?
Thx
Bernhard
What do you have against the breadcrumbs that appear automatically on namespaces with subpages?
To make that work, change at Skin.php wfMsgExt( 'tagline', 'parsemag' ) to wfMsgExt( 'bernhard-breadcrumbs', 'parse' ) and you will be able to add that code to MediaWiki:bernhard-breadcrumbs
@Platonides: Sounds great, thank you. However, didn't work so far. Could there be a cache problem (the Mediawiki:Tagline still works although disabled...)?
There are a few extensions for breadcrumbs out there, but they do not quite what I want (as is the case with the breadcrumbs you mention). This should be an ideal way, if it works.
Sorry for my silly questions. I am just beginning to get a picture...
B.
-----Ursprüngliche Nachricht----- Von: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] Im Auftrag von Platonides Gesendet: Mittwoch, 14. April 2010 13:31 An: mediawiki-l@lists.wikimedia.org Betreff: Re: [Mediawiki-l] tagline
ElScheid, Bernhard wrote:
Sorry for yet another small problem: I discovered that it should be possible to turn the page subtitle (which is usually hidden by CSS) into a good way to show "breadcrumbs" adding some magic words to MediaWiki:Tagline. The only problem: Links are not parsed correctly, neither in Wikicode nor in HTML (actually both ways are not parsed at all).
Example: {{SITENAME}} {{#if: {{NAMESPACE}} |
{{NAMESPACE}}
}}
{{BASEPAGENAME}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2 }} |
{{#titleparts: {{PAGENAME}} | 1 | 2 }}
}} {{#if: {{#titleparts: {{PAGENAME}} | 1 | 3 }} |
{{#titleparts: {{PAGENAME}} | 1 | 3 }}
}}
Ideally, something like [[Main Page|{{SITENAME}}]], etc. should work. Any solution?
Thx
Bernhard
What do you have against the breadcrumbs that appear automatically on namespaces with subpages?
To make that work, change at Skin.php wfMsgExt( 'tagline', 'parsemag' ) to wfMsgExt( 'bernhard-breadcrumbs', 'parse' ) and you will be able to add that code to MediaWiki:bernhard-breadcrumbs
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org