Template:SMW display activity-oneline: Difference between revisions

From OLPC
Jump to navigation Jump to search
(move tests of image size to Template:SMW display activity-onelineTEST)
(link the image ourselves)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
''In development''
''In development''
You can use this template in a semantic query to display 'Activity' semantic information, e.g. the info from [[Berkeley logo]].
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]].
Goal is to display information in the same format as [[Template:Activity]] and/or [[Template:Activity-oneline]].


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 (copied using View &gt; Source of [[Activities]] page, 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]].
This uses HTML &lt;table&gt; &lt;tr&gt; &lt;td&gt; syntax (copied using View &gt; Source of [[Activities]] page, 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]].
Line 15: Line 15:
{{#ask:
{{#ask:
[[ some criteria]] ...
[[ some criteria]] ...
| format=template
| template=SMW display activity-oneline
| ?Sugar icon
| ?Sugar icon
NOTE, missing out on Activity ID
NOTE, missing out on Activity ID
Line 22: Line 20:
| ?Activity bundle
| ?Activity bundle
| ?Activity version
| ?Activity version
|format=template
|template=SMW display activity-oneline
|link=none
}}
}}
</pre>
</pre>
Line 34: Line 35:
<table class="olpc-activity-info" border="1" cellpadding="3" cellspacing="0">
<table class="olpc-activity-info" border="1" cellpadding="3" cellspacing="0">
<tr valign="top">
<tr valign="top">
<td align="center" width="5%"> {{{2}}}
<td align="center" width="5%"> [[{{{2}}}|55px]]
</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><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></table>
</td></tr></table>

Latest revision as of 06:40, 7 February 2009

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 (copied using View > Source of Activities page, 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]] ...
  | ?Sugar icon
   NOTE, missing out on Activity ID
  | ?Short description
  | ?Activity bundle
  | ?Activity version
  |format=template
  |template=SMW display activity-oneline
  |link=none
}}

See query at Activity query examples.

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.


[[{{{2}}}|55px]] {{{1}}}: {{{3}}}
Download: {{{4}}} (v.{{{5}}})