On Friday 07 April 2006 10:53, Tels wrote:
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:
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
addCSS('YourCodeHere') would result in:
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
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 ...
Institute AIFB, University of Karlsruhe, D-76128 Karlsruhe
mak(a)aifb.uni-karlsruhe.de phone +49 (0)721 608 7362
fax +49 (0)721 693 717