Difference between revisions of "Template:Main-panel2"

From Wikispooks
Jump to navigation Jump to search
(test)
 
(Table layout)
Line 13: Line 13:
 
<nowiki>}}</nowiki>
 
<nowiki>}}</nowiki>
 
</noinclude><includeonly><includeonly>
 
</noinclude><includeonly><includeonly>
<div style="border-bottom:1px solid #9a9a9a; background-color:#d0e5f5; padding:0.5em 0.5em; font-size:112%;text-align:center;">'''{{#if: {{{link|}}}|[[{{{link}}}|{{{title|}}}]]|{{{title|}}}}}'''</div>
+
{|
<div style="padding:0.5em 0.5em 0.5em 0.5em;font-size:102%;">
+
|<div style="border-bottom:1px solid #9a9a9a; background-color:#d0e5f5; padding:0.5em 0.5em; font-size:112%;text-align:center;">'''{{#if: {{{link|}}}|[[{{{link}}}|{{{title|}}}]]|{{{title|}}}}}'''{{#if: {{{image|}}}|[[Image:{{{image}}}|link={{{link|}}}|alt={{{alt|}}}|center|65px]]}}</div>
{{#Ask: {{{ask|}}}
+
|-
|sort={{#if: {{{sort1|}}}|{{{sort1|}}}|Creation date}}
+
|<div style="padding:0.5em 0.5em 0.5em 0.5em;font-size:102%;">{{#Ask: {{{ask|}}} |sort={{#if: {{{sort1|}}}|{{{sort1|}}}|Creation date}} |order=descending |format=ul |limit={{#if: {{{limit|}}}|{{{limit}}}|6}}}}</div>
|order=descending
+
|-
|format=ul
+
|<div style="padding:0.5em 0.5em 0.5em 0.5em;font-size:102%;">{{#Ask: {{{ask|}}} |sort={{#if: {{{sort2|}}}|{{{sort2|}}}|Modification date}} |order=descending |format=ul |limit={{#if: {{{limit|}}}|{{{limit}}}|6}}}}</div>
|limit={{#if: {{{limit|}}}|{{{limit}}}|6}}
+
|}
}}</div>
 
<div style="padding:0.5em 0.5em 0.5em 0.5em;font-size:102%;">
 
{{#if: {{{image|}}}|[[Image:{{{image}}}|link={{{link|}}}|alt={{{alt|}}}|center|65px]]}}
 
{{#Ask: {{{ask|}}}
 
|sort={{#if: {{{sort2|}}}|{{{sort2|}}}|Modification date}}
 
|order=descending
 
|format=ul
 
|limit={{#if: {{{limit|}}}|{{{limit}}}|6}}
 
}}</div>
 

Revision as of 15:32, 10 August 2014

This template makes a double panel for the main page.

Usage:
{{Main-panel2
|ask= The SMW Query expression
|image= image for the section header
|alt= alt text for the image
|limit= how many results to show (defaults to 6)
|link= where to link the image and text
|title= section title
|sort1= property to sort the left panel on (defaults to Creation date)
|sort2= property to sort the right panel on (defaults to Modification date)
}}