The template format used to display a table of images

From semantic-mediawiki.org
Jump to: navigation, search
ExamplesExamples/QueriesThe template format used to display a table of images
Templates for displaying images
This page shows an example for the template format used to display a table of images.
Format
Keywords
Table of Contents

Simple example

Query not using a template

{{#ask:
 [[Category:City]]
 [[Has image::+]]
 |?Has image=image
 |offset=0
 |limit=5
}}
Result for simple query without using template
 image
AmsterdamAmsterdam - Waag.jpg
BellevilleBelleville, IL Sign.jpg
Frankfurt40564870 7c39a94ac4 z.jpg
KarlsruheKarlsruher Pyramide.JPG
London2166320938 5cfc9ec72a z.jpg
... further results

Advanced examples

Query using three templates

{{#ask:
 [[Category:City]]
 [[Has image::+]]
 |?Has image
 |format=template
 |headers=show
 |link=none
 |template=Demo/Template/City/Image
 |introtemplate=Demo/Template/City/Image/Intro
 |outrotemplate=Demo/Template/City/Image/Outro
 |offset=0
 |limit=20
}}
Result

The above query will yield a table output containing images of selected cities.

... further results

Templates used

Query using one template in three modes

{{Demo/Template/City/ImageShow|userparam=intro}}
{{#ask:
 [[Category:City]]
 [[Has image::+]]
 |?Has image=image
 |format=template
 |headers=show
 |link=none
 |template=Demo/Template/City/ImageShow
 |userparam=row
 |named args=yes
 |offset=0
 |limit=5
}}
{{Demo/Template/City/ImageShow|userparam=outro}}
Result
City Image
Demo:Amsterdam
Amsterdam - Waag.jpg
Belleville
Belleville, IL Sign.jpg
Frankfurt
40564870 7c39a94ac4 z.jpg
Karlsruhe
Karlsruher Pyramide.JPG
Demo:London
2166320938 5cfc9ec72a z.jpg
Template used