Difference between revisions of "Template:Class"

From TSAS Library
Jump to: navigation, search
Line 1: Line 1:
<repeat table="Courses" criteria={{{1}}} sort={{{2}}}>
<repeat table="Courses" criteria="{{{1}}}" sort="{{{2}}}">
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>


Line 12: Line 12:


Param '''2''' completes '''sort='''<nowiki>{{{1}}}</nowiki>, but is not working at the moment...
Param '''2''' completes '''sort='''<nowiki>{{{1}}}</nowiki>, but is not working at the moment...
{| class="wikitable"
|+Variables
|-
| coursename || sessions || offered || CC
|-
| description || prerequisites || opento || FA
|-
| department || note || requiredby || LA
|-
| teacher || grcode || 09-12 || ST
|}


<pre><repeat table="Courses" criteria={{{1}}} sort={{{2}}}>
==Use==
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>
<pre>{{class|offered{{=}}19-20|}}</pre>
 
{{{description}}}
 
<p style="margin-left:1em;">{{{requiredby}}}</p>
 
</repeat></pre>
 
Use: <pre>{{class|"offered{{=}}19-20"|}}</pre>
 
Yields:
{{class|"offered{{=}}19-20"|}}
 
<repeat table="Courses" criteria="offered=19-20" sort=>
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>
 
{{{description}}}
 
<p style="margin-left:1em;">{{{requiredby}}}</p>
 
</repeat>


==Yields==
{{class|offered{{=}}19-20|coursename}}
</noinclude>
</noinclude>

Revision as of 20:40, 11 May 2019

<repeat table="Courses" criteria="{{{1}}}" sort="{{{2}}}">

[[{{{coursename}}}]]

{{{teacher}}}

{{{description}}}

{{{requiredby}}}

</repeat>

Plain course layout drawing from Courses table (data).

Param 1 completes criteria={{{1}}} so should include quotation marks and the use of {{=}} to transclude an equals sign.

Param 2 completes sort={{{1}}}, but is not working at the moment...

Variables
coursename sessions offered CC
description prerequisites opento FA
department note requiredby LA
teacher grcode 09-12 ST

Use

{{class|offered{{=}}19-20|}}

Yields

<repeat table="Courses" criteria="offered=19-20" sort="coursename">

[[{{{coursename}}}]]

{{{teacher}}}

{{{description}}}

{{{requiredby}}}

</repeat>