Template:SMW display activity-oneline: Difference between revisions

From OLPC
Jump to navigation Jump to search
(interim)
 
(display some template params)
Line 6: Line 6:


Another approach might be to just use <tt>format=embedded</tt> in the semantic query, which embeds each matching page, and keep the activity info on a subpage, e.g. [[Berkeley logo/badge]]
Another approach might be to just use <tt>format=embedded</tt> in the semantic query, which embeds each matching page, and keep the activity info on a subpage, e.g. [[Berkeley logo/badge]]

This uses HTML &lt;table&gt; &lt;tr&gt; &lt;td&gt; syntax, because skierpage heard that trying to use wiki table markup in a template with SMW had all kinds of problems. But should verify that, because it's a hassle to reinvent the layout of [[Template:Activity-oneline]].


[[Category:Templates that display semantic query results]]
[[Category:Templates that display semantic query results]]
Line 15: Line 17:
| format=template
| format=template
| template=SMW display activity-oneline
| template=SMW display activity-oneline
| ?Name
| ?Sugar icon
NOTE, missing out on Activity ID
| ?Stream
| ?Build
| ?Short description
| ?Tests component
| ?Activity bundle
| ?Objective
| ?Activity version
| ?Feature
| ?Test Tools
| ?Test Setup
| ?Test Procedure
| ?Expected Results and Pass Criteria
| ?Comments
}}
}}
</pre>
</pre>

Note that Template:activity-oneline also renders an Activity_ID, but as
<nowiki><span class="olpc-activity-id" style="display:none;">{{{activity_id|}}}</span></nowiki>
so you don't see it.
</noinclude>
</noinclude>
<table>
<tbody><tr>
<td valign="top" width="50%">
<table class="olpc-activity-info" border="1" cellpadding="3" cellspacing="0">


''HARDCODED''<br />
<table class="olpc-activity-info" border="1" cellpadding="3" cellspacing="0">
<tbody><tr valign="top">
<tbody><tr valign="top">
<td align="center" width="5%"> <a href="/go/Image:Activity-journal.svg" class="image" title="Activity-journal.svg"><img alt="" src="/images/thumb/6/64/Activity-journal.svg/40px-Activity-journal.svg.png" border="0" height="40" width="40"></a>
<td align="center" width="5%"> <a href="/go/Image:Activity-journal.svg" class="image" title="Activity-journal.svg"><img alt="" src="/images/thumb/6/64/Activity-journal.svg/40px-Activity-journal.svg.png" border="0" height="40" width="40"></a>
</td><td> <b><a href="/go/Journal" title="Journal">Journal</a>:</b> <span class="olpc-activity-id" style="display: none;">org.laptop.JournalActivity</span> Object and activity browser <br> <i>Download</i>: <span class="olpc-activity-url"><a href="http://dev.laptop.org/%7Eerikos/journal/Journal-86.xo" class="external text" title="http://dev.laptop.org/~erikos/journal/Journal-86.xo" rel="nofollow">Journal-86.xo</a></span> (v.<span class="olpc-activity-version">86</span>)
</td><td> <b><a href="/go/Journal" title="Journal">Journal</a>:</b> <span class="olpc-activity-id" style="display: none;">org.laptop.JournalActivity</span> Object and activity browser <br> <i>Download</i>: <span class="olpc-activity-url"><a href="http://dev.laptop.org/%7Eerikos/journal/Journal-86.xo" class="external text" title="http://dev.laptop.org/~erikos/journal/Journal-86.xo" rel="nofollow">Journal-86.xo</a></span> (v.<span class="olpc-activity-version">86</span>)
</td></tr></tbody></table>


'' Generated''
<table class="olpc-activity-info" border="1" cellpadding="3" cellspacing="0">
<tbody><tr valign="top">
<td align="center" width="5%"> {{{2}}}
</td><td> <b>{{{1}}}:</b> <span class="olpc-activity-id" style="display: none;">org.laptop.TODO TODO TODO</span> {{{3}}}<br> <i>Download</i>: <span class="olpc-activity-url">{{{4}}}</span> (v.<span class="olpc-activity-version">{{{5}}}</span>)
</td></tr></tbody></table>
</td></tr></tbody></table>

Revision as of 11:43, 6 August 2008

In development You can use this template in a semantic query to display 'Activity' semantic information, e.g. the info from Berkeley logo.

Goal is to display information in the same format as Template:Activity and/or Template:Activity-oneline.

Another approach might be to just use format=embedded in the semantic query, which embeds each matching page, and keep the activity info on a subpage, e.g. Berkeley logo/badge

This uses HTML <table> <tr> <td> syntax, because skierpage heard that trying to use wiki table markup in a template with SMW had all kinds of problems. But should verify that, because it's a hassle to reinvent the layout of Template:Activity-oneline.

The query that calls it needs to request display of these fields in the same order

{{#ask:
  [[ some criteria]] ...
  | format=template
  | template=SMW display activity-oneline
  | ?Sugar icon
   NOTE, missing out on Activity ID
  | ?Short description
  | ?Activity bundle
  | ?Activity version
}}

Note that Template:activity-oneline also renders an Activity_ID, but as

 <span class="olpc-activity-id" style="display:none;">{{{activity_id|}}}</span>

so you don't see it.


HARDCODED

<tbody></tbody>
<a href="/go/Image:Activity-journal.svg" class="image" title="Activity-journal.svg"><img alt="" src="/images/thumb/6/64/Activity-journal.svg/40px-Activity-journal.svg.png" border="0" height="40" width="40"></a> <a href="/go/Journal" title="Journal">Journal</a>: Object and activity browser
Download: <a href="http://dev.laptop.org/%7Eerikos/journal/Journal-86.xo" class="external text" title="http://dev.laptop.org/~erikos/journal/Journal-86.xo" rel="nofollow">Journal-86.xo</a> (v.86)

Generated

<tbody></tbody>
{{{2}}} {{{1}}}: {{{3}}}
Download: {{{4}}} (v.{{{5}}})