StarfinderWiki
Log in

Template:Product slider

From StarfinderWiki
Template documentation (for the above template, sometimes hidden or invisible)

{{Product slider}} generates two slideshow parser functions, one with images and one with links to products. It's designed for use with the New Products box on Pathfinder Wiki.

Template

{{Product slider
| sliderid = 
| refresh  = 

| title1 = 
| image1 = 
| width1 = 
| link1  = 

| title2 = 
...
}}

{{Product slider}} uses a looping parser function to scale to as many entries as needed, and it tries to be clever when applying variables to require as little markup as possible. In other words, it can be as simple as adding one line per title to create a slider with up to 100 titles.

The image and text sliders are rendered as the content of a table cell followed by a table row break ( |- ) and a second table cell, so it is strongly recommended that this template be used inside of a wikitext table (see example).

Usage

sliderid (optional but strongly recommended)
The id parameter for the slider. Each slider on a page must have a unique ID. The image slider automatically suffixes "slider" after the sliderid, and the link slider beneath it automatically suffixes "links". Default is "unidentified".
refresh (optional)
The slider refresh rate in milliseconds. Default is 5,000 (5 seconds).
titlen
The title for each item in the slideshow and the link text that appears beneath the image.
imagen (optional)
The image filename, with extension, for the corresponding item. If no imagen parameter is provided, the template uses titlen followed by .jpg. Sliders cannot have items without images.
widthn (optional)
The width of the corresponding item's image. Default is 200px. Height-based measurements, like x200px for a 200-pixel-tall image, are allowed.
linkn (optional)
The link applied to the image and the target for the link text that appears beneath the image. If no linkn parameter is provided, the template uses titlen.

Example

{| class=tantable width=300
|-
|
{{Product slider
| sliderid = newbook

| title1 = The Penumbra Protocol
| title2 = Critical Hit Deck
| title3 = It Rests Beneath
| image3 = Coming Soon.jpg
| title4 = Honorbound Emissaries
| image4 = Coming Soon.jpg
}}
|}
The Penumbra Protocol
Critical Hit Deck
It Rests Beneath
Honorbound Emissaries

Here, because the image filename for title2 (The Penumbra Protocol) is exactly The Penumbra Protocol followed by .jpg, there's no need to specify the filename using image2—the template automatically slaps .jpg at the end of the title and uses that image. widthn and linkn are optional parameters and default to 200px and titlen, respectively.