Tools

Wiki templates

Wikimedia uses templates. These are bits of preprogrammed HTML which can be referred to by name. Very useful for replacing long editing instructions, for instance for quotes, in one go. You may use preprogrammed ones, to be found here, or create your own. To do the latter, suppose you want a template for special quotes. You first create a page Template:QuoteSpecial in your wiki. Then you write the relevant HTML code inside. Next, you can refer to this template by putting {{quote| in front of the text you are quoting, and }} after.

Intermezzo-frustrations

You’d think that there would be lots of pre-defined templates. In fact, there are. Thousands. The problem is, there is no way of knowing whether they work until you have gone through the trouble of installing them. This is true for the templates on Wikipedia but also on Fandom. Some years ago templates were extended by scripting language. Supposed to be wonderful. I followed all the instructions on MediaWikia and lots more elsewhere. I could not get it to work. Given my bad experience with the MediaWiki helpdesk -they just give up if the simple answer does not work – I gave up. After two days. Drove me crazy. As, judging by the comments, have been many others. I will look into this again in a few years time. Maybe they have got their act together. I am sure that if the concept of Wikpedia were not so successful, MediaWiki would have been abandoned a long time ago. Compared to say, WordPress, MediaWiki still has a lot to do. I will be constructing my own simple forms, I suppose. More about that in an update.

The update

Well, the update is sooner that I would have thought. Only the next day, and of course I have not been able to leave this thing alone. I felt heartened by countless other frustrated people obviously in search of solutions to the same problem: how to create a Wikipedia-style infobox. Like this one below.

Yes, I have succeeded. Finally. Although I should not have, because it really was a crazy search with little chance of success. There are so many things that can go wrong. I will write down the problems I had to solve. Maybe it will be of some use to someone.

List of problems overcome

  • There are various instructions on the web. I found this one on MediaWiki to be the best, as a starting point. It does say, in its current version, that is is just a draft.
  • Whatever went wrong, the result display on my testpage was always the same: “Script error: No such module “Infobox”.
  • I noticed that the imports from Wikipedia (step 2 and 3 in the instruction) had resulted in some 30+ modules without any code, just error messages. I deleted them one by one, this is the way of MediaWiki, alas. When I re-imported them again at the end of this list of “problems overcome” they all imported beautifully, without any error. I could hardly believe it.
  • The extension Scribunto caused problems. All or most files in the directory “engine” need to have permission 755, but some of them did not. I changed all of them to 755 using DirectAdmin supplied by my hosting provider.
  • When I tried to import Infobox page into my wiki, I got an error message saying that “proc_delete” could not be executed. Well, this is what took me more than a day. It turns out that this is parameter in a PHP.ini file which is managed by my provider. For safety’s sake, they have disable a number of commands. You can change this, but you have to know how. Eventually I found out that on DirectAdmin there is a menu option called PHP version, which also allows you to change the settings on “disable_functions”.
  • When I next tried to import the Infobox page from Wikipedia, I got an error message saying that “sanitized-css” was not there. Well, that was an another half day. It turns out that the (current!) installation of extension TemplateStyle needs to be fixed using a “composer” command. I could find no other way to fix the problem. So I turned my attention to this “composer” which turns out to be a dependency manager for PHP libraries. Do not think for a minute that I know what that means! But apparently one has to have it. It does not come pre-installed with MediaWiki. I did not install it through MediaWiki but through my hosting provider (see next point).
  • Composer works with a command-line interface which my provider calls Secure Shell (SSH). This is the way programmers can directly interface with the hosted installation. My hosting provider started providing SSH access back in 2016, possibly many other providers do to. Installing SSH means first telling DirectAdmin who (what IP-address) is going to be accessing this options. This is a safeguard against authorised use.
  • Having activated SSH through Direct admin, I had to install an app which would allow me to interface, i.e. a terminal emulator. I use PuTTy. For PuTTy, I first had to generate keys, using Putty Gen. Fortunately this bit was all very well explained by my hosting provider. I generated public and private keys and configured PuTTy to work with my site.
  • Next I had to install “composer”. Again, my hosting provider saved me by providing very clear instructions.
  • Last but not least: the command “composer install –no-dev” had to be run inside the direction where the extension TemplateStyle lives. I ran it, and it appeared to work. In spite of the fact that as far as I know I did not get the installation from Git, as it says in the instructions for installing the extension TemplateStyle.
  • I then re-imported the Infobox template.. and it worked! I did have to open my testpage for editing and then save it again, to see the effect.
  • Later, I noticed that the tagline of my mediawiki installation had started to appear on evere page. Apparently this happened when I created the CSS en JS files (see instruction). The value for the ‘magic word” Sitename is stated in Local Settings, but if you comment that out, the tagline reverts to ‘Media Wiki”. I just wanted it gone. After a while I found out where to change this. Namely in a page called concept.theartofmisunderstanding.org/index.php?title=MediaWiki:Common.css … where the first bit until the / is the location of my wiki. I commented out the last lines, like so:

Wikimedia uses templates. These are bits of preprogrammed HTML which can be referred to by name. Very useful for replacing long editing instructions, for instance for quotes, in one go. You may use preprogrammed ones, to be found here, or create your own. To do the latter, suppose you want a template for special quotes. You first create a page Template:QuoteSpecial in your wiki. Then you write the relevant HTML code inside. Next, you can refer to this template by putting {{quote| in front of the text you are quoting, and }} after.

Intermezzo-frustrations

You’d think that there would be lots of pre-defined templates. In fact, there are. Thousands. The problem is, there is no way of knowing whether they work until you have gone through the trouble of installing them. This is true for the templates on Wikipedia but also on Fandom. Some years ago templates were extended by scripting language. Supposed to be wonderful. I followed all the instructions on MediaWikia and lots more elsewhere. I could not get it to work. Given my bad experience with the MediaWiki helpdesk -they just give up if the simple answer does not work – I gave up. After two days. Drove me crazy. As, judging by the comments, have been many others. I will look into this again in a few years time. Maybe they have got their act together. I am sure that if the concept of Wikpedia were not so successful, MediaWiki would have been abandoned a long time ago. Compared to say, WordPress, MediaWiki still has a lot to do. I will be constructing my own simple forms, I suppose. More about that in an update.

The update

Well, the update is sooner that I would have thought. Only the next day, and of course I have not been able to leave this thing alone. I felt heartened by countless other frustrated people obviously in search of solutions to the same problem: how to create a Wikipedia-style infobox. Like this one below.

Yes, I have succeeded. Finally. Although I should not have, because it really was a crazy search with little chance of success. There are so many things that can go wrong. I will write down the problems I had to solve. Maybe it will be of some use to someone.

List of problems overcome

  • There are various instructions on the web. I found this one on MediaWiki to be the best, as a starting point. It does say, in its current version, that is is just a draft.
  • Whatever went wrong, the result display on my testpage was always the same: “Script error: No such module “Infobox”.
  • I noticed that the imports from Wikipedia (step 2 and 3 in the instruction) had resulted in some 30+ modules without any code, just error messages. I deleted them one by one, this is the way of MediaWiki, alas. When I re-imported them again at the end of this list of “problems overcome” they all imported beautifully, without any error. I could hardly believe it.
  • The extension Scribunto caused problems. All or most files in the directory “engine” need to have permission 755, but some of them did not. I changed all of them to 755 using DirectAdmin supplied by my hosting provider.
  • When I tried to import Infobox page into my wiki, I got an error message saying that “proc_delete” could not be executed. Well, this is what took me more than a day. It turns out that this is parameter in a PHP.ini file which is managed by my provider. For safety’s sake, they have disable a number of commands. You can change this, but you have to know how. Eventually I found out that on DirectAdmin there is a menu option called PHP version, which also allows you to change the settings on “disable_functions”.
  • When I next tried to import the Infobox page from Wikipedia, I got an error message saying that “sanitized-css” was not there. Well, that was an another half day. It turns out that the (current!) installation of extension TemplateStyle needs to be fixed using a “composer” command. I could find no other way to fix the problem. So I turned my attention to this “composer” which turns out to be a dependency manager for PHP libraries. Do not think for a minute that I know what that means! But apparently one has to have it. It does not come pre-installed with MediaWiki. I did not install it through MediaWiki but through my hosting provider (see next point).
  • Composer works with a command-line interface which my provider calls Secure Shell (SSH). This is the way programmers can directly interface with the hosted installation. My hosting provider started providing SSH access back in 2016, possibly many other providers do to. Installing SSH means first telling DirectAdmin who (what IP-address) is going to be accessing this options. This is a safeguard against authorised use.
  • Having activated SSH through Direct admin, I had to install an app which would allow me to interface, i.e. a terminal emulator. I use PuTTy. For PuTTy, I first had to generate keys, using Putty Gen. Fortunately this bit was all very well explained by my hosting provider. I generated public and private keys and configured PuTTy to work with my site.
  • Next I had to install “composer”. Again, my hosting provider saved me by providing very clear instructions.
  • Last but not least: the command “composer install –no-dev” had to be run inside the direction where the extension TemplateStyle lives. I ran it, and it appeared to work. In spite of the fact that as far as I know I did not get the installation from Git, as it says in the instructions for installing the extension TemplateStyle.
  • I then re-imported the Infobox template.. and it worked! I did have to open my testpage for editing and then save it again, to see the effect.
  • Later, I noticed that the tagline of my mediawiki installation had started to appear on evere page. Apparently this happened when I created the CSS en JS files (see instruction). The value for the ‘magic word” Sitename is stated in Local Settings, but if you comment that out, the tagline reverts to ‘Media Wiki”. I just wanted it gone. After a while I found out where to change this. Namely in a page called concept.theartofmisunderstanding.org/index.php?title=MediaWiki:Common.css … where the first bit until the / is the location of my wiki. I commented out the last lines, like so:

}
/* Display “From Wikipedia, the free encyclopedia” in skins that support it, do not apply to print mode */
/*@media screen {
/* #siteSub {
/* display: block;
/* }
}

Leave a Reply