Difference between revisions of "Template:File Gallery"

From Ludlow Family Wiki
Jump to: navigation, search
(Created page with "<noinclude>Generate a section containing a grid of files based on a query. If nothing matches, the result is empty. * First parameter: SMW query to execute * ''title'': title...")
 
m (9 revisions imported: Initial import from smithfam)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>Generate a section containing a grid of files based on a query.  If nothing matches, the result is empty.
 
<noinclude>Generate a section containing a grid of files based on a query.  If nothing matches, the result is empty.
 
* First parameter: SMW query to execute
 
* First parameter: SMW query to execute
* ''title'': title for the section header
+
* ''title'': title for the section header; default is "Related Files"
 
* ''caption'': property to use as a caption; default is none
 
* ''caption'': property to use as a caption; default is none
* ''limit'': max size; default is 40
+
* ''sort'': property or property list for sorting; default is "File Year"
</noinclude><includeonly>{{Wrap|== {{#if: {{{title|}}} | {{{title}}} | Related Files }} ==
+
* ''limit'': max size; default is 60
|{{#ask: {{{1|}}}
+
(Query has to be run twice, first to check for any results, because the "gallery" format does not produce true empty output.)
 +
</noinclude><includeonly>{{#if:
 +
{{#ask: {{{1|}}}
 +
| {{#if: {{{caption|}}} | ?{{{caption}}} }}
 +
| sort={{#if: {{{sort|}}} | {{{sort}}} | File Year }}
 +
| limit=1
 +
}}
 +
| {{H2|{{#if: {{{title|}}} | {{{title}}} | Related Files}}}}
 +
 
 +
{{#ask: {{{1|}}}
 
| {{#if: {{{caption|}}} | ?{{{caption}}} }}
 
| {{#if: {{{caption|}}} | ?{{{caption}}} }}
 
| format=gallery
 
| format=gallery
| sort=File Year
+
| sort={{#if: {{{sort|}}} | {{{sort}}} | File Year }}
 
| autocaptions=off
 
| autocaptions=off
| limit={{#if: {{{limit|}}} | {{{limit}}} | 40 }}
+
| limit={{#if: {{{limit|}}} | {{{limit}}} | 60 }}
 
| searchlabel=More
 
| searchlabel=More
 
}}}}</includeonly>
 
}}}}</includeonly>

Latest revision as of 19:14, 8 December 2015

Generate a section containing a grid of files based on a query. If nothing matches, the result is empty.

  • First parameter: SMW query to execute
  • title: title for the section header; default is "Related Files"
  • caption: property to use as a caption; default is none
  • sort: property or property list for sorting; default is "File Year"
  • limit: max size; default is 60

(Query has to be run twice, first to check for any results, because the "gallery" format does not produce true empty output.)