Last modified: 2011-08-25 08:55:49 UTC
As mentioned on [[Help:Books/Feedback/Archives/2010/May#The_extension_is_not_parsing_templates]], the extension is not expanding templates before loading a collection. Currently, in the function loadCollection[1] we have a loop for parsing each line of the collection, but it uses the value of $article->getContent() in the following loop foreach ( preg_split( '/[\r\n]+/', $article->getContent() ) as $line ) { Instead of that, it should be used the preprocessed text, such as that which appears on [[Special:ExpandTemplates]]. The code of this ExpandTemplates extension uses $output = $wgParser->preprocess( $input, $title, $options ); to get the expanded content in the special page. I believe the same function can be used for Collection extension. [1] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Collection/Collection.body.php?view=markup [2] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ExpandTemplates/ExpandTemplates_body.php?revision=77003&view=markup
Maybe it could have also an API parameter to which the users could provide the name of a page whose (expanded) content would be used to load a collection.
Unassigning default assignments. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/54734
There are some reasons why we won't implement that: 1. We'd like to keep it simple. Currently collection pages can be parsed using some simple regular expressions. If we would allow templates, one would need to write a complete template expander in order to parse them (or rely on mediawiki's expander). 2. There's no way I can think of to load and save those books from the collection interface while at the same time keeping calls to templates intact in the general case (when saving a collectionpage). 3. We'd like to able to use template syntax as a way to store additional meta-information about the book, like in: {{saved_book |title=Hadronic Matter |subtitle=An overview |cover-image=Quark structure proton.svg |cover-color= }} at the top of a collectionpage.