LogoLogo
  • Welcome
  • Getting Started
  • Integration Methods
  • SDKs
  • Tebex for Unreal Engine 5
  • Tebex for Unity Engine
  • Webstore Builder
    • Overview
    • Getting Started
    • Twig
      • Tags
      • Filters
      • Functions
    • Global Variables
      • basket
      • store
      • page
    • Pages
      • index.html
      • checkout.html
      • username.html
      • options.html
      • package.html
      • cms/page.html
      • category.html
      • layout.html
    • Sidebar Modules
      • module.communitygoal.html
      • module.featuredpackage.html
      • module.giftcardbalance.html
      • module.goal.html
      • module.payments.html
      • module.serverstatus.html
      • module.textbox.html
      • module.topdonator.html
    • Assets
    • Schema
    • Developer Plan
    • Footer
    • Guides
      • Package Slugs
  • Headless API
    • Overview
    • Getting Your Listings
    • Creating a Basket
    • Adding Packages
    • Gifting Packages
    • Applying Discounts / Creator Codes
    • Directing to Checkout
    • Endpoints
    • Postman Config
    • Example Integration
  • Checkout API
    • Overview
    • Headers and Authentication
    • Start the Checkout Process
    • Checkout Webhooks
    • Endpoints
    • Errors
    • Postman Config
  • Tebex.js
    • Overview
    • Integration
    • Events
    • Web Components
    • Custom Render Location
    • NPM
    • GitHub
  • Webhooks
    • Overview
    • Login Webhooks
  • Game Server API
    • Overview
    • Authentication
    • Error Handling
    • Endpoints
  • Affiliate API
    • Overview
    • Referrals
    • Game Types
    • Webhooks
Powered by GitBook
On this page
  • Available Functions
  • Function Documentation
  • __
  • _p
  • config
  • asset
  • path
  • query

Was this helpful?

Export as PDF
  1. Webstore Builder
  2. Twig

Functions

View the available functions within your Twig template.

PreviousFiltersNextGlobal Variables

Last updated 7 months ago

Was this helpful?

Functions generate content for you to use within your templates.

If you'd like access to a TWIG function that is not available below,

Available Functions

Function
Documentation

__

_p

config

asset

path

query

range

Function Documentation

__

Returns the equivalent translation from within your translations settings.

{{ __('Redeem coupons / gift cards') }}

// prints "Redeems coupons / gift cards" (Or the equivalent translation if another language is selected)

_p

Returns the plural translation from within your translation settings.

{{ _p(":count items for :amount :currency", basket.packages|length, {'count' : basket.packages|length, 'amount' : basket.price|money, 'currency' : basket.currency}) }}

// prints "5 items for $5.00 USD"

config

{{ config("header-colour") }}

// prints the associated config value with the key header-colour

asset

Returns the full url path of an asset from within your template.

{{ asset("style.css") }}

// Prints the URL of style.css, such as https://your-store.tebex.io/template-assets/style.css"

path

Returns the full url path of the current page.

{{ path() }}

// Prints the full URL of the current page the customer is browsing on your store

query

Returns a GET parameter from the current url.

{{ query("test" }}

// Returns the GET param of "test" if it is provided in the URL.

Returns a config value from your .

please let us know.
template config schema
View
View
View
View
View
View
View