Difference between revisions of "Template:Lib/data/pairs"

From Issuepedia
Jump to navigation Jump to search
(func DumpTest)
(fixed some if/else mismatches)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>[[category:W3TPL]]</noinclude>
+
<hide>
 +
<func DataHdr>
 +
    <echo>[[category:data.links]]</echo>
 +
    <let keylist />
 +
</func>
 +
 
 
<func DataPair PairName PairVal>
 
<func DataPair PairName PairVal>
 
     <let name="$PairName" copy="PairVal" />
 
     <let name="$PairName" copy="PairVal" />
     <let name="PairList" append pre>\<get name="PairName" /></let>
+
     <let name="PairList" append>\</let>
 +
    <let name="PairList" append copy="PairName" />
 
</func>
 
</func>
  
 +
<!-- trace assigns / -->
 
<func DataShow>
 
<func DataShow>
     <xploop list="$Topics" repl=$s$>[[category:$s$]]</xploop>
+
    <if flag="NoShow" />
    <xploop list="$PairList" repl="$s$">
+
    <else><echo>
* '''$s$''': <get name="$s$.disp" />
+
==Data==</echo>
 +
    </else>
 +
     <xploop list="$PairList" var="key">
 +
        <let name="valDisp" copy="$key" />
 +
        <if comp="$key" with="Date">
 +
            <let name="valDisp" append> '''[[:category:</let>
 +
            <let name="valDisp" append copy="$key" />
 +
            <let name="valDisp" append>|C]] | [[</let>
 +
            <let name="valDisp" append copy="$key" />
 +
            <let name="valDisp" append>|P]]'''[[category:</let>
 +
            <let name="valDisp" append copy="$key" />
 +
            <let name="valDisp" append>]]</let>
 +
        </if>
 +
        <if flag="NoShow" />
 +
        <else>
 +
            <echo>
 +
* '''<get name="key" />''': <get name="valDisp" /></echo>
 +
        </else>
 
     </xploop>
 
     </xploop>
* '''Topic pages''':<xploop list="$Topics" repl=$s$>&ensp;[[$s$]]</xploop>
+
<if flag="NoShow" />
* '''Topic categories''':<xploop list="$Topics">&ensp;[[:category:$s$|$s$]]</xploop>
+
<else><echo>
 +
==Tags==
 +
* '''Pages''':<xploop list="$Topics" repl=$s$ echo>&ensp;[[$s$]]</xploop>
 +
* '''Categories''':<xploop list="$Topics" repl=$s$ echo>&ensp;[[:category:$s$|$s$]][[category:$s$|$s$]]</xploop></echo>
 +
 
 +
</else>
 +
</func>
 +
 
 +
<func DataBrief PageName>
 +
    <let name="out">'''</let>
 +
    <let name="out" append copy="Date" />
 +
    <let name="out" append>''' /'''[[</let>
 +
    <let name="out" append copy="PageName" />
 +
    <let name="out" append>|L]]'''/'''[[Talk:</let>
 +
    <let name="out" append copy="PageName" />
 +
    <let name="out" append>|D]]'''/ </let>
 +
    <echo><get name="out" /></echo>
 +
    <if flag="wpage>
 +
        <echo>[[<get name="wpage" />|<get name="Title" />]]</echo>
 +
    </if><else>
 +
        <let name="out">[</let>
 +
        <let name="out" append copy="URL" />
 +
        <let name="out" append> </let>
 +
        <let name="out" append copy="Title" />
 +
        <let name="out" append>]</let>
 +
        <echo><get name="out" /></echo>
 +
    </else>
 +
    <echo> <get name="Text" len=200 /> </echo>
 +
    <let name="out">''[[</let>
 +
    <let name="out" append copy="PageName" />
 +
    <let name="out" append>|more...]]''</let>
 +
    <echo><get name="out" /></echo>
 
</func>
 
</func>
  
<func DumpTest>
+
<func DataBriefRetro PageName>
     <dump trace />
+
    <if flag="PairList">
 +
        <call DataBrief PageName="$PageName" />
 +
    </if><else>
 +
        <echo>{{show.link.abbr|<get name="PageName" />|200}}</echo>
 +
     </else>
 
</func>
 
</func>
 +
</hide>

Latest revision as of 16:03, 31 August 2008