Template:Demo/Template/City/ImageShow

From Linux Web Expert

This is an advanced demo template used in connection with an example related to the result format "template".

This template is used in three modes:

  1. intro
  2. outro
  3. table row

the mode is given as the userparam parameter for this template

Usage

{{Demo/Template/City/ImageShow|userparam=intro}}
{{#ask:
 [[Category:City]]
 [[Has image::+]]
 |mainlabel=city
 |?Has image=image
 |format=template
 |headers=show
 |link=none
 |template=Demo/Template/City/ImageShow
 |userparam=row
 |named args=yes
 |offset=3
 |limit=3
}}
{{Demo/Template/City/ImageShow|userparam=outro}}

Example

City Image

Code for intro

Starts a wiki table

{| class="smworgtable"
 ! City
 ! style="width: 90px" | Image
 |-

Code for outro

|}

Code for tablerow

 |  style="text-align: left" | [[{{{?city|}}}]] 
 |  style="text-align: center; width: 150px" | [[{{{?image|}}}|center|150px]]
 |-

modal Code properly escaped

<includeonly>{{#switch:{{{userparam|}}}|intro={{{!}} class="smworgtable"
{{!}}-
! City 
! style="width: 90px" {{!}} Image
{{!}}-
|outro={{!}}}
|row={{!}}-
{{!}}style="text-align: left" {{!}} [[{{{?city|}}}]] 
{{!}}style="text-align: center; width: 150px" {{!}} [[{{{?image|}}}|center|150px]]
{{!}}-
}}</includeonly>

See also