This doc is part of the custom template documentation. You can see all the docs here!

This doc explains all the variables & helper functions that you might need to use.

Variables

Category Info

Any pages which wish to display category information need to call the {{ getCategories() }} helper function.

Product Info

Any pages which wish to display product information need to call the {{ getProducts(queryParameters.category) }} helper function. Categories is optional.

Variable Table

pathParameters - Object

Any path parameters which that have come from the current route defined in routes.json

queryParameters - Object

Any query parameters on the request

templateSettings - Object

Any settings which have been defined in settings.json and optionally set in the portal in the template selection

socials - Object

socials - object
youtube - string
twitch - string
facebook - string
instagram - string
twitter - string
discord - string
tiktok - string

store - Object

name - string
currency - string
currencySymbol - string

server - Object

url - string
playerCount - string

categories - Array

(coming soon!)

products - Array (object)
Is an array of:

identifier - string
name - string
shortDescription - string
image - string (url) or empty
price - number in lowest nominal amount (e.g. pence)

product - Object

identifier - string
name - string
shortDescription - string
longDescription - string (plain, markdown or HTML, will auto-render if used in template)
image - string (url) or empty
price - number in lowest nominal amount (e.g. pence)

isLoggedIn - Boolean

basket - Object

totalPrice - string (number to 2DP)
totalItems - number

items - Array (object)

name - string
serverName - string
serverIdentifier - string
quantity - number
price - string - number in lowest nominal amount (e.g. pence)
priceTotal - string - number in lowest nominal amount (e.g. pence)
productIdentifier - string

isLoading - Boolean

Helper Functions

getCategories

function that takes void

getProducts

function that takes optional categoryIdentifier

getProduct

function that takes productIdentifier

push

function that takes path to go to on click, generates javascript click event which can be added to a click event

getServersForProduct

function that takes <TODO>

getCategoryName

function that takes <TODO>

addToBasket

function that takes productIdentifier, serverIdentifier and quantity

incrementQuantity

function that takes quantity, previousQuantity, productIdentifier and serverIdentifier

checkout

function that takes successPath and failurePath and will generate a javascript click function which can be added to a click event to start payment processing

usernameInput

function that takes <TODO> which will add username input / user display information on page

donationInput

function that takes <TODO> which will add donation fields / donation information to page

json

function that takes object purely for helping purposes to display on raw JSON of object on page
Was this article helpful?
Cancel
Thank you!