one more day is over @ ceylan's office

Coding, not a profession but a joy…

Archive for the ‘wiki’ tag

Original Content Mediawiki Extension

without comments

Original Content has emeged based on the need explained in my previous post Content from Wikipedia Sister Projects and Licensing . You may want to read that post to find out the motivation for that…

So here is how Original Content works:

- You copy an existing template or an image from an established wiki project ex: wikipedia.

- You want to inherit the documentation and licensing notice automagically.

- The extension hooks into magic word original.

- You create a template with

{{#original:{{{domain}}}|{{FULLPAGENAMEE}}|{{{path}}}|{{{lang}}}|{{{indexPath}}}|{{{protocol}}}}}

[[Category:Content From External Wikies]]
[[Category:Original Content Templates]]
{{pp-template|small=yes}}

{{Documentation}}

This once created once for the whole site and shared by other templates.

- For each and every web site you want to link with, you need to create a template with below in it

{{OriginalContent|domain=wikipedia.org|path=/wiki/|lang=en|indexPath=|protocol=http}}
[[Category:Content From Wikipedia]]

[[Category:Original Content Templates]]
{{pp-template|small=yes}}

{{Documentation}}

Now when you createnew article that has content from that wiki, you simple drop the name of the second template.

From here on, on every access to the articles linked to that specific template we have created:

* Article looks up using Special:Export on the original content’s wiki site for information.

* If information required is found, it is expanded with Special:ExpandTemplates.

* If expanded successfully, relative links for images and anchors are converted to absolute ones with reference to the original web site.

* The information is cached in a local file. That will be good for a week after which, will be expired and re-looked up from the originating site.

* On subsequent reviews, information is retreived form that cache.

The extension is quite ready with the one exception being: by default Media Wiki thinks the html inserted is from user and sanitizes the images and links,  meaning <img> and <a> tags are escaped. So instead of links and images, codes for links and images shown.

Popularity: 3%

Written by Hasan Ceylan

February 8th, 2010 at 9:25 pm

Posted in solved, web sites

Tagged with ,