Difference between revisions of "Template:Class"

From TSAS Library
Jump to: navigation, search
 
(16 intermediate revisions by the same user not shown)
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> {{{3|<p style="float:right;">{{{teacher}}}</p>}}}
 
{{{4|
{{{description}}}
 
<p style="margin-left:1em;">{{{requiredby}}}</p>
</repeat>
<noinclude>
Plain course layout drawing from Courses table.
 
Param 1 completes <nowiki>criteria={{{1}}}</nowiki> so should include quotation marks and the use of <nowiki>{{=}}</nowiki> to transclude an equals sign.
 
Param 2 completes <nowiki>sort={{{1}}}</nowiki>, but is not working at the moment...
 
<pre><repeat table="Courses" criteria={{{1}}} sort={{{2}}}>
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>
 
{{{description}}}
{{{description}}}
 
}}}
<p style="margin-left:1em;">{{{requiredby}}}</p>
<p style="margin-left:1em;">{{{requiredby}}}</p>
</repeat><noinclude>
Plain course layout drawing from [[Table:Courses|Courses table]] ([https://{{SERVERNAME}}/w/index.php?title=Table:Courses&action=viewdata data]).
{| class="wikitable"
|-
! Param !! Value
|-
| 1 || criteria=
|-
| 2 || sort=
|-
| 3 || Add pipe to hide teacher
|-
| 4 || Add pipe to hide description
|}


</repeat></pre>
{| class="wikitable"
 
|+Variables
Use: <pre>{{class|"offered{{=}}19-20"|}}</pre>
|-
 
| coursename || sessions || offered || CC
Yields:
|-
{{class|"offered{{=}}19-20"|}}
| description || prerequisites || opento || FA
 
|-
<repeat table="Courses" criteria="offered=Fall 2019" sort=>
| department || note || requiredby || LA
<h3 style="display:inline;">[[{{{coursename}}}]]</h3> <p style="float:right;">{{{teacher}}}</p>
|-
 
| teacher || grcode || 09-12 || ST
{{{description}}}
|}
 
<p style="margin-left:1em;">{{{requiredby}}}</p>


</repeat>
==Use==
<templatedata>
===Current Offerings===
{
<pre>{{class|offered{{=}}19-20||}}</pre>
"params": {
===Teacher Courses===
"1": {},
{{tip}}Add a space into Param 3 to remove teacher name
"2": {}
<pre>{{class|teacher{{=}}{{PAGENAME}}, grcode{{=}}EL|coursename|}}</pre>
},
<pre>{{class|teacher{{=}}{{PAGENAME}}, grcode!{{=}}EL|coursename|}}</pre>
"format": "inline"
===Department List===
}
<pre>{{class|department{{=}}{{PAGENAME}}, grcode{{=}}EL|coursename}}</pre>
</templatedata>
<pre>{{class|department{{=}}{{PAGENAME}}, grcode!{{=}}EL|coursename}}</pre>
==Yields==
{{class|offered{{=}}19-20|coursename|4=}}
{{Documentation}}
</noinclude>
</noinclude>

Latest revision as of 12:12, 12 May 2019

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

[[{{{coursename}}}]]

{{{teacher}}}

{{{description}}}

{{{requiredby}}}

</repeat> Plain course layout drawing from Courses table (data).

Param Value
1 criteria=
2 sort=
3 Add pipe to hide teacher
4 Add pipe to hide description
Variables
coursename sessions offered CC
description prerequisites opento FA
department note requiredby LA
teacher grcode 09-12 ST

Use

Current Offerings

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

Teacher Courses

Note Note:Add a space into Param 3 to remove teacher name

{{class|teacher{{=}}{{PAGENAME}}, grcode{{=}}EL|coursename|}}
{{class|teacher{{=}}{{PAGENAME}}, grcode!{{=}}EL|coursename|}}

Department List

{{class|department{{=}}{{PAGENAME}}, grcode{{=}}EL|coursename}}
{{class|department{{=}}{{PAGENAME}}, grcode!{{=}}EL|coursename}}

Yields

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

[[{{{coursename}}}]]

{{{teacher}}}

{{{requiredby}}}

</repeat>