On Friday 07 April 2006 10:53, Tels wrote:
Moin,
as an extension developer I'd like to have two new features. I looked at the doc, the code the FAQ etc but I couldn't find out if it is not already possible to achive that:
- addCSS();
You can call from your extension things like addMeta(), addHeader() etc, including addStyleSheet(), which adds a link to a stylesheet to the page. However, forvarious reaons and extensions adding CSS code into the head ala:
addCSS('YourCodeHere') would result in:
<style type="text/css"> <!-- YourCdeHere --></style>
Is this already possible and did I just overlook it? If not, could it be implemented? (Adding a link to a stylesheet requires external files, which is messy and leaks files,see my other post "File leakage in extensions")
I don't know about this, since I am fine with addStyleSheet. Another problem, however, is *where* to call this method in an extension. If, e.g., you have a tiny parser extension that adds some new elements to each article-output during parsing, then you want all articles to have your new CSS. However, articles are often produced from the parser cache, which does not include the headers. Thus your code for adding CSS is typically not exectued on each view, but the CSS is not recovered from the cache either.
I don't know whether 1.6 provides new hooks for adding CSS and similar header stuff in extensions. AFAIK, the only way to get CSS into every page in 1.5 was to patch Ouptupage.php or something similar ...
See http://bugzilla.wikimedia.org/show_bug.cgi?id=5077
Best regards,
Markus