JavaScript within templates?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JavaScript within templates?

nakohdo
This post was updated on .
Besides using a template for adding a category to a page I would like to add the very same category name as a class to the page's body tag like so:

  jQuery('body').addClass('myCategory')

This would enable category based styling using CSS as suggested at http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Css_for_categories

Is this a feasible option?

I don't want to use namespaces as they are less flexible than categories.
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript within templates?

Daniel Barrett-3
CSS-based category styling seems (to me) not scalable. On a large wiki, articles may be in 5-10 categories each easily. Even if you have a precedence among the categories for styling, I think it would produce an inconsistent user experience.

What business problem are you really trying to solve here? Maybe Category CSS isn't the only solution.

DanB

_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l