7

Is there a way to insert an HTML checkbox in Mediawiki syntax?

<input> doesn't appear on their list of blessed tags, so I can't just insert it.

(FWIW, this is for a private documentation page which is a checklist, and I want to keep track of where I am as I go through it.)

Ken
  • 2,919

4 Answers4

7

This is a quick way to add something like a checkbox if it fits you:

<span style="font-size:21px">☐</span> 

Basically, it uses the 'hollow medium square' character "□" which is similar to a checkbox, but it is too small in its original form, so I had to apply some CSS to enlarge it.

To check it, replace it with a 'tick' mark. (✓, ✔, ☑, etc.)

Adjust the values to your needs.

2

These tags are just free-form wiki text, like markdown on SO, and are provided for formatting but not input. To add input html elements, or forms, use one of the MEdiawiki extensions, such as semantic forms or simple forms. Check this URL out for an overview of how form content is handled in Mediawiki.

Good luck.

slotishtype
  • 3,115
  • 1
  • 20
  • 19
0

This renders a nice list of checkboxes:

== My Wiki Header ==

Here's an example checklist:
<html>
<input type="checkbox"> Item A.<br>
<input type="checkbox"> Item B.<br>
<input type="checkbox"> Item C.<br>
</html>

I don't recall having any special configuration on my wiki. Of course the checkboxes won't do anything, they're just for the looks.

0

I just found another way to do it. It involves editing your mediawiki source, and depending which version you have, may not work just the same. This is for 1.15.3.

In the file sanitizer.php, near the end of the function setupAttributeWhitelist() add this line to the list

'input'      => array('type'),

Then find the function removeHTMLtags and add this to the end of the $htmlsingle (and for 1.19.4 and maybe an intermediate version, the $htmlsingleonly) array:

, 'input'
paulmorriss
  • 1,871