Difference between revisions of "6 May 2007"

From Organic Design wiki
(Categoriation parser-function)
 
m (typo)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{news:title=Categoriation parser-function|img=|text=
+
{{news|title=Categorisation parser-function|img=|msg=
 
Since we've upgraded from [[XmlWiki]], we've had a bit of trouble categorising our program-code articles since they don't use the wiki-parser. In [[XmlWiki]] this was achieved by adding the category information to the articles XML properties. Today I've modified the [[MW:Extension:CategoryHook|CategoryHook extension]] to also offer an additional [http://meta.wikimedia.org/wiki/Parser_functions parser function] which works exactly like a category link, for example:
 
Since we've upgraded from [[XmlWiki]], we've had a bit of trouble categorising our program-code articles since they don't use the wiki-parser. In [[XmlWiki]] this was achieved by adding the category information to the articles XML properties. Today I've modified the [[MW:Extension:CategoryHook|CategoryHook extension]] to also offer an additional [http://meta.wikimedia.org/wiki/Parser_functions parser function] which works exactly like a category link, for example:
 
:<tt><nowiki>{{Category:Foo|Bar}}</nowiki></tt>
 
:<tt><nowiki>{{Category:Foo|Bar}}</nowiki></tt>
 
This categorises the article into [[:Category:Foo]] using sort-key "Bar". It works because our script articles are still allowed to have their templates expanded before GeSHi parses them (see our [[GeSHi|GeSHi hack]] regarding this).
 
This categorises the article into [[:Category:Foo]] using sort-key "Bar". It works because our script articles are still allowed to have their templates expanded before GeSHi parses them (see our [[GeSHi|GeSHi hack]] regarding this).
 
*See [[MW:Extension:CategoryHook]] for installation and usage details of the ''CategoryHook'' extension.
 
*See [[MW:Extension:CategoryHook]] for installation and usage details of the ''CategoryHook'' extension.
*[[CategoryHook.php]] ''- the code of the extension''
+
*The extension code is [[CategoryHook.php]]
 +
*This method of categorisation is working correctly with DPL queries.
 
}}
 
}}

Latest revision as of 11:29, 16 May 2007

Warning.svg This is a blog item that needs to be converted to the new Bliki format


Categorisation parser-function

Since we've upgraded from XmlWiki, we've had a bit of trouble categorising our program-code articles since they don't use the wiki-parser. In XmlWiki this was achieved by adding the category information to the articles XML properties. Today I've modified the CategoryHook extension to also offer an additional parser function which works exactly like a category link, for example:

{{Category:Foo|Bar}}

This categorises the article into Category:Foo using sort-key "Bar". It works because our script articles are still allowed to have their templates expanded before GeSHi parses them (see our GeSHi hack regarding this).