Hi folks
I've been working on bringing back AjaxCategories the last two days (r92112 and followups, try it out by setting $wgUseAJAXCategories = true;
Obviously it can't edit or remove transcluded categories, so it would be good to not show the edit buttons on transcluded categories.
Question is, how could I get those? Anyone got an idea?
( I could do something like $templatesCache = $holders->parent->mTplExpandCache; foreach ( $templatesCache as $template ) { $strp = strpos($template, $line); if ( $strp ) break; }
inside parser->replaceInternalLinks2, L1980, but that's pretty hacky & not really stable either )
Leo
2011/7/14 Leo Koppelkamm diebuche@gmail.com:
( I could do something like $templatesCache = $holders->parent->mTplExpandCache; foreach ( $templatesCache as $template ) { $strp = strpos($template, $line); if ( $strp ) break; }
inside parser->replaceInternalLinks2, L1980, but that's pretty hacky & not really stable either )
$parser->mTplExpandCache holds only the text of template calls without parameters ( eg. {{Foo}} but not {{bar|x|y}} ), so it won't help you much. You could do a separate parse of the article text while skipping the preprocessor. This should give you only the categories that are linked directly from the page. Of course for normal page views this would probably be too expensive, so maybe an API module that you call via AJAX?
HTH,
Paul Copperman
wikitech-l@lists.wikimedia.org