Skip to content

Teil 2: Create Content

Container

Once the course itself - including navigation and various pages - has been created, you can populate the pages with content. To do this, so-called containers are available at the level immediately below the page; these can be divided into two categories: boxes and views. Containers generally organize page content and assign functionality to it. Boxes are containers that can only hold content, while Views can only contain other containers (Views or Boxes) as child elements.

Boxes

As an example of a box, first insert some text and then an exercise. The so-called textbox is intended for plain text that does not serve any other purpose, such as an exercise, an example, or the like. The text itself is often divided into paragraphs, which are marked with a p tag.

Textbox
<textbox>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
</textbox>  
The p tag is what’s known as a block element. It causes a line break, so the text starts on a new line. Another example of this is the table tag, which is used to define a table. In addition to block elements, there are also so-called inline elements that do not cause a line break. These often include formatting elements such as bold (strong) or italics (emph). The m tag, intended for formulas, is also an inline element. It allows you to write mathematical expressions in LaTeX notation, which are then rendered in the same way as in LaTeX.

textbox with text and a formula
<textbox>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
    <p>An example of a formula is <m>f(x) = x^2</m>.</p>
</textbox>  
One unique feature of the m tag is that it can be displayed as a block element, even though it is actually an inline element. To do this, you can use the display attribute:

textbox with text and a block formula
<textbox>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
    <p>An example of a formula is <m display="block">f(x) = x^2</m></p>
</textbox>  

The text so far should be followed by an exercise. The exercisebox tag is available for this purpose.

exercisebox
<textbox>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
    <p>An example of a formula is <m display="block">f(x) = x^2</m></p>
</textbox> 

<exercisebox>
    <p>Calculate the first derivative of <m display="block">f(x) = x^2</m></p>
</exercisebox>

Views

accordionview serves as an example of a view element. This element is used to create expandable elements (accordions). The individual expandable content items are, in turn, grouped together in another view, known as a groupview.

accordionview
<accordionview>
    <groupview>
        <title>Accordion 1</title>
        <textbox>
            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
        <textbox>
    </groupview>
    <groupview>
        <title>Accordion 2</title>
        <textbox>
            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
        <textbox>
    </groupview>
</accordionview> 

The complete page might then look like this:

Example of a Page
<page name="examplePage">
    <textbox>
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
        <p>An example of a formula is <m display="block">f(x) = x^2</m></p>
    </textbox> 

    <exercisebox>
        <p>Calculate the first derivative of <m display="block">f(x) = x^2</m></p>
    </exercisebox>

    <accordionview>
        <groupview>
            <title>Accordion 1</title>
            <textbox>
                <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
            <textbox>
        </groupview>
        <groupview>
            <title>Accordion 2</title>
            <textbox>
                <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</p>
            <textbox>
        </groupview>
    </accordionview> 
</page>