I meant the page content, mainly - articles content. I got how can I change the content of static parts like header and footer (by editing skin scripts). But now the actual problem is how to change the content of dynamic parts of content (best of all articles of Wikipedia).
Rowan Collins wrote:
On 05/07/05, Nicolay A. Vasiliev nvasiliev@whiteriversoft.com wrote:
presuming you are hoping to modify that output in some way, there may be an earlier stage of processing which your modification would conceptually fit into more neatly.
You're right - I try to do this. So, I'd like to know where is this point.
What I meant was, what is it you are trying to modify? The HTTP headers? Some element of the skin? Some element of the page content itself? The "behaviour" of certain content? Any of these things *could* be done by altering the final output, but in each case there would be a better place to make your change - the code isn't brilliantly organised, but it at least attempts to organise the process into conceptual stages. If you describe what you're trying to achieve, I or someone else may be able to point you to the best part of the code to modify.
I mean including some phrases from my own table into article content.
Nicolay A. Vasiliev wrote:
I meant the page content, mainly - articles content. I got how can I change the content of static parts like header and footer (by editing skin scripts). But now the actual problem is how to change the content of dynamic parts of content (best of all articles of Wikipedia).
Rowan Collins wrote:
Nicolay A. Vasiliev wrote:
I meant the page content, mainly - articles content. I got how can I change the content of static parts like header and footer (by editing skin scripts). But now the actual problem is how to change the content of dynamic parts of content (best of all articles of Wikipedia).
I mean including some phrases from my own table into article content.
Aha. So, as I thought, the very last stage of output probably isn't the most sensible place to edit anyway. So...
* do you want these extra "phrases" to be inserted "on demand", when you edit the page to include special syntax? If so, look at the extensions mechanism - http://meta.wikimedia.org/wiki/Write_your_own_MediaWiki_extension
* do you want these extra phrases to be inserted in reaction to certain words or phrases, or existing markup elements, appearing in the content (without having to actually add anything to the page)? [Or indeed, to appear as though they were part of the content, but on every single page - though this would seem a case for modifying the skin to me] If so, add a function in Parser.php and have it called from the internalParse() function.
* do you want these extra phrases to be inserted into the actual source text, not just the output? If so, either write a bot or a script talking to the database to add them en masse, or call a function from Parser::preSaveTransform() or pstPass2() so that they will be added to the article as it is saved (and beware of adding them twice :p)
* are none of these really what you're trying to do? In which case, perhaps you could explain in more detail what you're trying to do, and I'll endeavour to find the logical place for it to be done.
Oh, and finally, see docs/hooks.doc (or .txt) in the source distribution, which describes a system for creating extensions which insert code at various points without actually modifying the code. In fact, I hope you read this far, because that may be more helpful than my suggestions [although the version I just looked at doesn't list a hook for ArticleShow - a mistake, surely?]
wikitech-l@lists.wikimedia.org