Hello,
I would appreciate any help regarding inserting custom text into articles.
The problem setting is as follows: I am currently trying to create a wiki where each article is about a specific entity (say, for example, a book). Above each article's body content, I want to insert custom text (such as the author of the book, the retail price of the book, the publisher of the book, etc) in the form of HTML. I do not want the users to be able to edit these custom text, and thus I want to "inject" these text as the content of the page gets loaded.
What would be the cleanest approach to solve this problem? I have looked at the list of hooks available at http://www.mediawiki.org/wiki/Manual:Hooks, but was unable to find any hook that satisfied my need. I have also tried modifying the core code (the outputPage() method of the Skin class, for example), but things got ugly pretty quickly, and it was hard to maintain the code. I would appreciate any help.
Thanks in advance, Naoki Orii
A very simple-minded aproach. Perhaps not nice, but needs only adminship (if you keep it for trusted people) and the AbuseFilter extension. Create a subpage called* /header* for each page, and protect it. Then install a filter that won't let the user to save the page unless itt begins with the {{/header}} string. No hooks neccessary.
On Tue, 28 Feb 2012 15:53:31 -0800, Naoki Orii naoki.orii@gmail.com wrote:
Hello,
I would appreciate any help regarding inserting custom text into articles.
The problem setting is as follows: I am currently trying to create a wiki where each article is about a specific entity (say, for example, a book). Above each article's body content, I want to insert custom text (such as the author of the book, the retail price of the book, the publisher of the book, etc) in the form of HTML. I do not want the users to be able to edit these custom text, and thus I want to "inject" these text as the content of the page gets loaded.
What would be the cleanest approach to solve this problem? I have looked at the list of hooks available at http://www.mediawiki.org/wiki/Manual:Hooks, but was unable to find any hook that satisfied my need. I have also tried modifying the core code (the outputPage() method of the Skin class, for example), but things got ugly pretty quickly, and it was hard to maintain the code. I would appreciate any help.
Thanks in advance, Naoki Orii
Technically while the 'BeforePageDisplay' was meant for metadata it still should be run at a point that you can prepend/append to the bodytext. As long as you don't care about action=render.
wikitech-l@lists.wikimedia.org