PathfinderWiki
Log in

Template:Product slider/doc

From PathfinderWiki

{{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
| refresh  = 2000

| width1 = x260px
| title1 = Strategy Guide

| title2 = Melee Tactics Toolbox

| image3 = Season 6 placeholder.jpg
| title3 = Fires of Karamoss

| image4 = Tombs of Golarion.jpg
| title4 = Tombs of Golarion (Companion)
| link4  = Tombs of Golarion

| image5 = Season 6 placeholder.jpg
| title5 = The Golden Guardian
}}
|}
Strategy Guide
Melee Tactics Toolbox
Fires of Karamoss
Tombs of Golarion (Companion)
The Golden Guardian

Here, because the image filename for title2 (Melee Tactics Toolbox) is exactly Melee Tactics Toolbox 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.