Actions

TextCard

From MediaWiki Widgets

TextCard widget
Description:Allows you to add a TextCard
Author:Wesalius
Code:Widget:TextCard
Status:active
Updated:December 4, 2016
If you use code on your wiki which is older than this date you may want to update since your widget may be insecure or broken.
Security:unknown
Inv-Icon tools.svg.png

To copy this widget to your wiki, cut and paste the entire source of the TextCard widget code page into a page called Widget:TextCard on your wiki.

If you don't have the Widget extension set up on your wiki, go to its description page on MediaWiki.org and follow the installation instructions.


This widget allows you to add TextCards to your wiki page like in these three examples: Example 1, Example 2, Example 3.

It creates flashcard-like experience. Flashcards are loaded from a XML-formatted page which is usually stored on a subpage called "/source.

To insert this widget, use the following code:

{{#widget:TextCard
|param1=source
|param2=order
}}

Parameters

  • source - wikipage containing the xml formatted source
  • order - if not set, then defaults to order=1, sets the order in which the cardsets from source are loaded

You have to setup a page (usually a "/source" subpage) with sourcecode as in Example 1, Example 2, Example 3 at wikiskripta.eu.

Use the with following syntax:

<textcards>
<cardset>
<card>
  <question>Superquestion 1111</question>
  <question>Superquestion 111</question>
  <question>Superquestion 11</question>
  <question>Superquestion 1</question>
  <question>Question 1</question>
  <answer>Odpověď 1</answer>
  <comment>Komentář 1</comment>
</card>
<card>
  <question>Superquestion 2222</question>
  <question>Superquestion 222</question>
  <question>Superquestion 22</question>
  <question>Superquestion 2</question>
  <question>Question 2</question>
  <answer>Answer 2</answer>
  <comment>Comment 2</comment>
</card>
</cardset>
<cardset>
<card>
  <question>SSSSuperquestion 1111</question>
  <question>SSSuperquestion 111</question>
  <question>SSuperquestion 11</question>
  <question>Superquestion 1</question>
  <question>
    <![CDATA[
    QQuestion 1
    <ul>
      <li>xxx</li>
      <li>yyy</li>
      <li>zzz</li>
    </ul>
    ]]>
  </question>
  <answer>AAnswer 1</answer>
  <comment>CComment 1</comment>
</card>
<card>
  <question>NSSuperquestion 2222</question>
  <question>SSuperquestion 222</question>
  <question>SSuperquestion 22</question>
  <question>Superquestion 2</question>
  <question>QQuestion 2</question>
  <answer>AAnswer 2</answer>
  <comment>CComment 2</comment>
</card>
</cardset>
</textcards>
  • XML format
  • comment is not exposed in the output
  • any number of subsections is allowed
  • if the element contains HTML, it has to be enclosed in <![CDATA[ html_content ]]

Sample result

See Example 1, Example 2, Example 3 at wikiskripta.eu.

Comments

blog comments powered by Disqus