Chapter 7. Advanced Article Construction

So far, we’ve looked at wiki articles as individual documents, constructed from familiar parts like paragraphs, formatted text, bulleted lists, tables, and so on. In this view, the goal is to turn ideas into articles and to write and typeset them effectively. But of course, a wiki is more than a bunch of independent articles. The collection serves a common purpose, whether it’s an encyclopedia, a taxonomy of pets, or a corporate knowledge system. That’s why we use categories and namespaces to organize articles: to make the information findable and serve this common purpose. In this chapter, we’ll continue to take this “larger” view of the wiki and construct sets of articles that share information among themselves.

Suppose you’re writing a series of 50 wiki articles about pet illnesses, and every article contains the same link to a popular veterinary website. You could simply copy and paste the link into each article, but if the URL ever changed, you’d need to update all 50 articles. This kind of annoyance is called a maintenance problem, and it gets worse as wikis grow. With MediaWiki, you can avoid this problem by writing the URL in only one article and automatically making it appear in all 50, by way of a feature called transclusion. This is just one of MediaWiki’s sharing features we’ll discuss in this chapter. Others include:

Consistency maintenance

Why share content among articles?

Variables

Special words that stand for (and expand into) ...

Get MediaWiki now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.